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
29efcd44
Commit
29efcd44
authored
Dec 13, 2010
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MSVC: fixes for complex types
parent
b734ecc0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+3
-3
tests/run/complex_numbers_T305.pyx
tests/run/complex_numbers_T305.pyx
+3
-3
No files found.
Cython/Compiler/PyrexTypes.py
View file @
29efcd44
...
@@ -1371,10 +1371,10 @@ impl="""
...
@@ -1371,10 +1371,10 @@ impl="""
}
}
#if %(is_float)s
#if %(is_float)s
static CYTHON_INLINE %(real_type)s __Pyx_c_abs%(m)s(%(type)s z) {
static CYTHON_INLINE %(real_type)s __Pyx_c_abs%(m)s(%(type)s z) {
#if HAVE_HYPOT
#if !defined(HAVE_HYPOT) || defined(_MSC_VER)
return hypot%(m)s(z.real, z.imag);
#else
return sqrt%(m)s(z.real*z.real + z.imag*z.imag);
return sqrt%(m)s(z.real*z.real + z.imag*z.imag);
#else
return hypot%(m)s(z.real, z.imag);
#endif
#endif
}
}
static CYTHON_INLINE %(type)s __Pyx_c_pow%(m)s(%(type)s a, %(type)s b) {
static CYTHON_INLINE %(type)s __Pyx_c_pow%(m)s(%(type)s a, %(type)s b) {
...
...
tests/run/complex_numbers_T305.pyx
View file @
29efcd44
...
@@ -28,8 +28,8 @@ def test_pow(double complex z, double complex w, tol=None):
...
@@ -28,8 +28,8 @@ def test_pow(double complex z, double complex w, tol=None):
Various implementations produce slightly different results...
Various implementations produce slightly different results...
>>> a = complex(3, 1)
>>> a = complex(3, 1)
>>> test_pow(a, 1)
>>> test_pow(a, 1
, 1e-15
)
(3+1j)
True
>>> test_pow(a, 2, 1e-15)
>>> test_pow(a, 2, 1e-15)
True
True
>>> test_pow(a, a, 1e-15)
>>> test_pow(a, a, 1e-15)
...
@@ -48,7 +48,7 @@ def test_int_pow(double complex z, int n, tol=None):
...
@@ -48,7 +48,7 @@ def test_int_pow(double complex z, int n, tol=None):
[True, True, True, True, True, True, True, True, True]
[True, True, True, True, True, True, True, True, True]
>>> [test_int_pow(complex(0, 2), k, 1e-15) for k in range(-4, 5)]
>>> [test_int_pow(complex(0, 2), k, 1e-15) for k in range(-4, 5)]
[True, True, True, True, True, True, True, True, True]
[True, True, True, True, True, True, True, True, True]
>>> [test_int_pow(complex(2, 0.5), k, 1e-1
5
) for k in range(0, 10)]
>>> [test_int_pow(complex(2, 0.5), k, 1e-1
4
) for k in range(0, 10)]
[True, True, True, True, True, True, True, True, True, True]
[True, True, True, True, True, True, True, True, True, True]
"""
"""
if
tol
is
None
:
if
tol
is
None
:
...
...
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