Commit 1259dc21 authored by Stefan Behnel's avatar Stefan Behnel

Declare constants in "libc.math" with "const" modifier to detect/avoid assignments etc.

Closes #2621.
parent 2a8dd0c0
......@@ -71,6 +71,8 @@ Features added
* New C macro ``CYTHON_HEX_VERSION`` to access Cython's version in the same style as
``PY_HEX_VERSION``.
* Constants in ``libc.math`` are now declared as ``const`` to simplify their handling.
Bugs fixed
----------
......
cdef extern from "<math.h>" nogil:
double M_E
double e "M_E" # as in Python's math module
double M_LOG2E
double M_LOG10E
double M_LN2
double M_LN10
double M_PI
double pi "M_PI" # as in Python's math module
double M_PI_2
double M_PI_4
double M_1_PI
double M_2_PI
double M_2_SQRTPI
double M_SQRT2
double M_SQRT1_2
const double M_E
const double e "M_E" # as in Python's math module
const double M_LOG2E
const double M_LOG10E
const double M_LN2
const double M_LN10
const double M_PI
const double pi "M_PI" # as in Python's math module
const double M_PI_2
const double M_PI_4
const double M_1_PI
const double M_2_PI
const double M_2_SQRTPI
const double M_SQRT2
const double M_SQRT1_2
# C99 constants
float INFINITY
float NAN
const float INFINITY
const float NAN
# note: not providing "nan" and "inf" aliases here as nan() is a function in C
double HUGE_VAL
float HUGE_VALF
long double HUGE_VALL
const double HUGE_VAL
const float HUGE_VALF
const long double HUGE_VALL
double acos(double x)
double asin(double x)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment