Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
1259dc21
Commit
1259dc21
authored
Sep 22, 2018
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Declare constants in "libc.math" with "const" modifier to detect/avoid assignments etc.
Closes #2621.
parent
2a8dd0c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
20 deletions
+22
-20
CHANGES.rst
CHANGES.rst
+2
-0
Cython/Includes/libc/math.pxd
Cython/Includes/libc/math.pxd
+20
-20
No files found.
CHANGES.rst
View file @
1259dc21
...
...
@@ -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
----------
...
...
Cython/Includes/libc/math.pxd
View file @
1259dc21
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment