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
5da90229
Commit
5da90229
authored
Jan 19, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Must use repr() not str() for literal floats.
parent
b6bdc98a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+3
-3
No files found.
Cython/Compiler/ExprNodes.py
View file @
5da90229
...
...
@@ -885,7 +885,7 @@ class FloatNode(ConstNode):
return
float
(
self
.
value
)
def
calculate_result_code
(
self
):
strval
=
str
(
self
.
value
)
strval
=
repr
(
float
(
self
.
value
)
)
if
strval
==
'nan'
:
return
"(Py_HUGE_VAL * 0)"
elif
strval
==
'inf'
:
...
...
@@ -1042,9 +1042,9 @@ class ImagNode(AtomicNewTempExprNode):
def
generate_result_code
(
self
,
code
):
code
.
putln
(
"%s = PyComplex_FromDoubles(0.0, %
s
); %s"
%
(
"%s = PyComplex_FromDoubles(0.0, %
r
); %s"
%
(
self
.
result
(),
self
.
value
,
float
(
self
.
value
)
,
code
.
error_goto_if_null
(
self
.
result
(),
self
.
pos
)))
code
.
put_gotref
(
self
.
py_result
())
...
...
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