math.pxd 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. cdef extern from "<math.h>" nogil:
  2. const double M_E
  3. const double e "M_E" # as in Python's math module
  4. const double M_LOG2E
  5. const double M_LOG10E
  6. const double M_LN2
  7. const double M_LN10
  8. const double M_PI
  9. const double pi "M_PI" # as in Python's math module
  10. const double M_PI_2
  11. const double M_PI_4
  12. const double M_1_PI
  13. const double M_2_PI
  14. const double M_2_SQRTPI
  15. const double M_SQRT2
  16. const double M_SQRT1_2
  17. # C99 constants
  18. const float INFINITY
  19. const float NAN
  20. # note: not providing "nan" and "inf" aliases here as nan() is a function in C
  21. const double HUGE_VAL
  22. const float HUGE_VALF
  23. const long double HUGE_VALL
  24. double acos(double x)
  25. double asin(double x)
  26. double atan(double x)
  27. double atan2(double y, double x)
  28. double cos(double x)
  29. double sin(double x)
  30. double tan(double x)
  31. double cosh(double x)
  32. double sinh(double x)
  33. double tanh(double x)
  34. double acosh(double x)
  35. double asinh(double x)
  36. double atanh(double x)
  37. double hypot(double x, double y)
  38. double exp(double x)
  39. double exp2(double x)
  40. double expm1(double x)
  41. double log(double x)
  42. double logb(double x)
  43. double log2(double x)
  44. double log10(double x)
  45. double log1p(double x)
  46. int ilogb(double x)
  47. double lgamma(double x)
  48. double tgamma(double x)
  49. double frexp(double x, int* exponent)
  50. double ldexp(double x, int exponent)
  51. double modf(double x, double* iptr)
  52. double fmod(double x, double y)
  53. double remainder(double x, double y)
  54. double remquo(double x, double y, int *quot)
  55. double pow(double x, double y)
  56. double sqrt(double x)
  57. double cbrt(double x)
  58. double fabs(double x)
  59. double ceil(double x)
  60. double floor(double x)
  61. double trunc(double x)
  62. double rint(double x)
  63. double round(double x)
  64. double nearbyint(double x)
  65. double nextafter(double, double)
  66. double nexttoward(double, long double)
  67. long long llrint(double)
  68. long lrint(double)
  69. long long llround(double)
  70. long lround(double)
  71. double copysign(double, double)
  72. float copysignf(float, float)
  73. long double copysignl(long double, long double)
  74. double erf(double)
  75. float erff(float)
  76. long double erfl(long double)
  77. double erfc(double)
  78. float erfcf(float)
  79. long double erfcl(long double)
  80. double fdim(double x, double y)
  81. double fma(double x, double y, double z)
  82. double fmax(double x, double y)
  83. double fmin(double x, double y)
  84. double scalbln(double x, long n)
  85. double scalbn(double x, int n)
  86. double nan(const char*)
  87. int isinf(long double) # -1 / 0 / 1
  88. bint isfinite(long double)
  89. bint isnan(long double)
  90. bint isnormal(long double)
  91. bint signbit(long double)
  92. int fpclassify(long double)
  93. const int FP_NAN
  94. const int FP_INFINITE
  95. const int FP_ZERO
  96. const int FP_SUBNORMAL
  97. const int FP_NORMAL