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
67b77198
Commit
67b77198
authored
Jan 23, 2020
by
Jerome Kieffer
Committed by
Robert Bradshaw
Jan 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide support for the complex library (#2891)
parent
632ec1a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
Cython/Includes/libc/complex.pxd
Cython/Includes/libc/complex.pxd
+35
-0
tests/run/complex_numbers_cmath_T2891.pyx
tests/run/complex_numbers_cmath_T2891.pyx
+15
-0
No files found.
Cython/Includes/libc/complex.pxd
0 → 100644
View file @
67b77198
cdef
extern
from
"<complex.h>"
nogil
:
# Trigonometric functions.
double
complex
cacos
(
double
complex
z
)
double
complex
casin
(
double
complex
z
)
double
complex
catan
(
double
complex
z
)
double
complex
ccos
(
double
complex
z
)
double
complex
csin
(
double
complex
z
)
double
complex
ctan
(
double
complex
z
)
# Hyperbolic functions.
double
complex
cacosh
(
double
complex
z
)
double
complex
casinh
(
double
complex
z
)
double
complex
catanh
(
double
complex
z
)
double
complex
ccosh
(
double
complex
z
)
double
complex
csinh
(
double
complex
z
)
double
complex
ctanh
(
double
complex
z
)
# Exponential and logarithmic functions.
double
complex
cexp
(
double
complex
z
)
double
complex
clog
(
double
complex
z
)
double
complex
clog10
(
double
complex
z
)
# Power functions.
double
complex
cpow
(
double
complex
x
,
double
complex
y
)
double
complex
csqrt
(
double
complex
z
)
# Absolute value, conjugates, and projection.
double
cabs
(
double
complex
z
)
double
carg
(
double
complex
z
)
double
complex
conj
(
double
complex
z
)
double
complex
cproj
(
double
complex
z
)
# Decomposing complex values.
double
cimag
(
double
complex
z
)
double
creal
(
double
complex
z
)
tests/run/complex_numbers_cmath_T2891.pyx
0 → 100644
View file @
67b77198
# ticket: 2891
# tag: c, no-cpp
cdef
extern
from
"complex_numbers_c99_T398.h"
:
pass
from
libc.complex
cimport
cimag
,
creal
,
cabs
,
carg
def
test_decomposing
(
double
complex
z
):
"""
>>> test_decomposing(3+4j)
(3.0, 4.0, 5.0, 0.9272952180016122)
"""
return
(
creal
(
z
),
cimag
(
z
),
cabs
(
z
),
carg
(
z
))
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