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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
36549f78
Commit
36549f78
authored
Sep 05, 2007
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better error for ** on integer types.
parent
0bf428d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+9
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
36549f78
...
...
@@ -2610,6 +2610,15 @@ class PowNode(NumBinopNode):
def
c_types_okay
(
self
,
type1
,
type2
):
return
type1
.
is_float
or
type2
.
is_float
def
type_error
(
self
):
if
not
(
self
.
operand1
.
type
.
is_error
or
self
.
operand2
.
type
.
is_error
):
if
self
.
operand1
.
type
.
is_int
and
self
.
operand2
.
type
.
is_int
:
error
(
self
.
pos
,
"C has no integer powering, use python ints or floats instead '%s' (%s; %s)"
%
(
self
.
operator
,
self
.
operand1
.
type
,
self
.
operand2
.
type
))
else
:
NumBinopNode
.
type_error
(
self
)
self
.
type
=
PyrexTypes
.
error_type
def
calculate_result_code
(
self
):
return
"pow(%s, %s)"
%
(
self
.
operand1
.
result_code
,
self
.
operand2
.
result_code
)
...
...
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