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
d9ce56c7
Commit
d9ce56c7
authored
Dec 04, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make 'complex' the C double complex type instead of Python's complex object type
parent
3e75aa6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+8
-0
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+1
-1
No files found.
Cython/Compiler/Nodes.py
View file @
d9ce56c7
...
@@ -786,6 +786,14 @@ class CSimpleBaseTypeNode(CBaseTypeNode):
...
@@ -786,6 +786,14 @@ class CSimpleBaseTypeNode(CBaseTypeNode):
error
(
self
.
pos
,
"can only complexify c numeric types"
)
error
(
self
.
pos
,
"can only complexify c numeric types"
)
type
=
PyrexTypes
.
CComplexType
(
type
)
type
=
PyrexTypes
.
CComplexType
(
type
)
type
.
create_declaration_utility_code
(
env
)
type
.
create_declaration_utility_code
(
env
)
elif
type
is
Builtin
.
complex_type
:
# Special case: optimise builtin complex type into C's
# double complex. The parser cannot do this (as for the
# normal scalar types) as the user may have redeclared the
# 'complex' type. Testing for the exact type here works.
type
=
PyrexTypes
.
c_double_complex_type
type
.
create_declaration_utility_code
(
env
)
self
.
complex
=
True
if
type
:
if
type
:
return
type
return
type
else
:
else
:
...
...
Cython/Compiler/PyrexTypes.py
View file @
d9ce56c7
...
@@ -2318,7 +2318,7 @@ modifiers_and_name_to_type = {
...
@@ -2318,7 +2318,7 @@ modifiers_and_name_to_type = {
(
1
,
0
,
"double"
):
c_double_type
,
(
1
,
0
,
"double"
):
c_double_type
,
(
1
,
1
,
"double"
):
c_longdouble_type
,
(
1
,
1
,
"double"
):
c_longdouble_type
,
(
1
,
0
,
"complex"
):
c_
float_complex_type
,
(
1
,
0
,
"complex"
):
c_
double_complex_type
,
# C: float, Python: double => Python wins
(
1
,
0
,
"floatcomplex"
):
c_float_complex_type
,
(
1
,
0
,
"floatcomplex"
):
c_float_complex_type
,
(
1
,
0
,
"doublecomplex"
):
c_double_complex_type
,
(
1
,
0
,
"doublecomplex"
):
c_double_complex_type
,
(
1
,
1
,
"doublecomplex"
):
c_longdouble_complex_type
,
(
1
,
1
,
"doublecomplex"
):
c_longdouble_complex_type
,
...
...
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