PageRenderTime 38ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Lib/math.i

#
Swig | 82 lines | 36 code | 22 blank | 24 comment | 0 complexity | 315fcf465d3a714c05a1bff7e47d5855 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* -----------------------------------------------------------------------------
  2. * math.i
  3. *
  4. * SWIG library file for floating point operations.
  5. * ----------------------------------------------------------------------------- */
  6. %module math
  7. %{
  8. #include <math.h>
  9. %}
  10. extern double cos(double x);
  11. /* Cosine of x */
  12. extern double sin(double x);
  13. /* Sine of x */
  14. extern double tan(double x);
  15. /* Tangent of x */
  16. extern double acos(double x);
  17. /* Inverse cosine in range [-PI/2,PI/2], x in [-1,1]. */
  18. extern double asin(double x);
  19. /* Inverse sine in range [0,PI], x in [-1,1]. */
  20. extern double atan(double x);
  21. /* Inverse tangent in range [-PI/2,PI/2]. */
  22. extern double atan2(double y, double x);
  23. /* Inverse tangent of y/x in range [-PI,PI]. */
  24. extern double cosh(double x);
  25. /* Hyperbolic cosine of x */
  26. extern double sinh(double x);
  27. /* Hyperbolic sine of x */
  28. extern double tanh(double x);
  29. /* Hyperbolic tangent of x */
  30. extern double exp(double x);
  31. /* Natural exponential function e^x */
  32. extern double log(double x);
  33. /* Natural logarithm ln(x), x > 0 */
  34. extern double log10(double x);
  35. /* Base 10 logarithm, x > 0 */
  36. extern double pow(double x, double y);
  37. /* Power function x^y. */
  38. extern double sqrt(double x);
  39. /* Square root. x >= 0 */
  40. extern double fabs(double x);
  41. /* Absolute value of x */
  42. extern double ceil(double x);
  43. /* Smallest integer not less than x, as a double */
  44. extern double floor(double x);
  45. /* Largest integer not greater than x, as a double */
  46. extern double fmod(double x, double y);
  47. /* Floating-point remainder of x/y, with the same sign as x. */
  48. #define M_E 2.7182818284590452354
  49. #define M_LOG2E 1.4426950408889634074
  50. #define M_LOG10E 0.43429448190325182765
  51. #define M_LN2 0.69314718055994530942
  52. #define M_LN10 2.30258509299404568402
  53. #define M_PI 3.14159265358979323846
  54. #define M_PI_2 1.57079632679489661923
  55. #define M_PI_4 0.78539816339744830962
  56. #define M_1_PI 0.31830988618379067154
  57. #define M_2_PI 0.63661977236758134308
  58. #define M_2_SQRTPI 1.12837916709551257390
  59. #define M_SQRT2 1.41421356237309504880
  60. #define M_SQRT1_2 0.70710678118654752440