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
348974c8
Commit
348974c8
authored
Sep 22, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pow(float, -) for MSVC.
parent
552b6994
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+9
-3
No files found.
Cython/Compiler/ExprNodes.py
View file @
348974c8
...
...
@@ -5658,7 +5658,7 @@ class PowNode(NumBinopNode):
error
(
self
.
pos
,
"complex powers not yet supported"
)
self
.
pow_func
=
"<error>"
elif
self
.
type
.
is_float
:
self
.
pow_func
=
"pow"
self
.
pow_func
=
"pow"
+
self
.
type
.
math_h_modifier
else
:
self
.
pow_func
=
"__Pyx_pow_%s"
%
self
.
type
.
declaration_code
(
''
).
replace
(
' '
,
'_'
)
env
.
use_utility_code
(
...
...
@@ -5666,10 +5666,16 @@ class PowNode(NumBinopNode):
type
=
self
.
type
.
declaration_code
(
''
)))
def
calculate_result_code
(
self
):
# Work around MSVC overloading ambiguity.
def
typecast
(
operand
):
if
self
.
type
==
operand
.
type
:
return
operand
.
result
()
else
:
return
self
.
type
.
cast_code
(
operand
.
result
())
return
"%s(%s, %s)"
%
(
self
.
pow_func
,
self
.
operand1
.
result
(
),
self
.
operand2
.
result
(
))
typecast
(
self
.
operand1
),
typecast
(
self
.
operand2
))
# Note: This class is temporarily "shut down" into an ineffective temp
...
...
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