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
3a2a66e2
Commit
3a2a66e2
authored
Oct 28, 2009
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix complex return values
parent
a2cce2b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+1
-0
tests/run/complex_numbers_T305.pyx
tests/run/complex_numbers_T305.pyx
+6
-0
No files found.
Cython/Compiler/PyrexTypes.py
View file @
3a2a66e2
...
...
@@ -875,6 +875,7 @@ class CComplexType(CNumericType):
CNumericType
.
__init__
(
self
,
real_type
.
rank
+
0.5
,
real_type
.
signed
)
self
.
binops
=
{}
self
.
from_parts
=
"%s_from_parts"
%
self
.
specalization_name
()
self
.
default_value
=
"%s(0, 0)"
%
self
.
from_parts
def
__eq__
(
self
,
other
):
if
isinstance
(
self
,
CComplexType
)
and
isinstance
(
other
,
CComplexType
):
...
...
tests/run/complex_numbers_T305.pyx
View file @
3a2a66e2
...
...
@@ -66,6 +66,9 @@ __doc__ = u"""
>>> test_coerce_typedef_multiply(3, 1j)
(3j)
>>> complex_retval()
1j
"""
...
...
@@ -128,3 +131,6 @@ def test_conjugate_typedef(cdouble z):
ctypedef
double
mydouble
def
test_coerce_typedef_multiply
(
mydouble
x
,
double
complex
z
):
return
x
*
z
cpdef
double
complex
complex_retval
():
return
1j
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