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 ...@@ -71,6 +71,8 @@ Features added
* New C macro ``CYTHON_HEX_VERSION`` to access Cython's version in the same style as * New C macro ``CYTHON_HEX_VERSION`` to access Cython's version in the same style as
``PY_HEX_VERSION``. ``PY_HEX_VERSION``.
* Constants in ``libc.math`` are now declared as ``const`` to simplify their handling.
Bugs fixed Bugs fixed
---------- ----------
......
cdef extern from "<math.h>" nogil: cdef extern from "<math.h>" nogil:
double M_E const double M_E
double e "M_E" # as in Python's math module const double e "M_E" # as in Python's math module
double M_LOG2E const double M_LOG2E
double M_LOG10E const double M_LOG10E
double M_LN2 const double M_LN2
double M_LN10 const double M_LN10
double M_PI const double M_PI
double pi "M_PI" # as in Python's math module const double pi "M_PI" # as in Python's math module
double M_PI_2 const double M_PI_2
double M_PI_4 const double M_PI_4
double M_1_PI const double M_1_PI
double M_2_PI const double M_2_PI
double M_2_SQRTPI const double M_2_SQRTPI
double M_SQRT2 const double M_SQRT2
double M_SQRT1_2 const double M_SQRT1_2
# C99 constants # C99 constants
float INFINITY const float INFINITY
float NAN const float NAN
# note: not providing "nan" and "inf" aliases here as nan() is a function in C # note: not providing "nan" and "inf" aliases here as nan() is a function in C
double HUGE_VAL const double HUGE_VAL
float HUGE_VALF const float HUGE_VALF
long double HUGE_VALL const long double HUGE_VALL
double acos(double x) double acos(double x)
double asin(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