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
Kirill Smelkov
cython
Commits
ebf10c7f
Commit
ebf10c7f
authored
9 years ago
by
scoder
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #493 from Nikratio/master
FROM_PY_FUNCTION: Cast to sdigit after unary minus, not before
parents
eca0803d
9c100bce
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
Cython/Utility/Optimize.c
Cython/Utility/Optimize.c
+2
-1
Cython/Utility/TypeConversion.c
Cython/Utility/TypeConversion.c
+1
-1
No files found.
Cython/Utility/Optimize.c
View file @
ebf10c7f
...
...
@@ -659,7 +659,8 @@ static PyObject* __Pyx_PyInt_{{op}}{{order}}(PyObject *op1, PyObject *op2, CYTHO
x
=
a
%
b
;
x
+=
((
x
!=
0
)
&
((
x
^
b
)
<
0
))
*
b
;
{{
elif
op
==
'
TrueDivide
'
}}
if
(
8
*
sizeof
(
long
)
<=
53
||
(
__Pyx_sst_abs
(
size
)
<=
52
/
PyLong_SHIFT
)
||
likely
(
labs
({{
ival
}})
<=
(
1L
<<
53
)))
{
if
((
8
*
sizeof
(
long
)
<=
53
||
likely
(
labs
({{
ival
}})
<=
(
1L
<<
53
)))
||
__Pyx_sst_abs
(
size
)
<=
52
/
PyLong_SHIFT
)
{
return
PyFloat_FromDouble
((
double
)
a
/
(
double
)
b
);
}
return
PyLong_Type
.
tp_as_number
->
nb_
{{
slot_name
}}(
op1
,
op2
);
...
...
This diff is collapsed.
Click to expand it.
Cython/Utility/TypeConversion.c
View file @
ebf10c7f
...
...
@@ -685,7 +685,7 @@ static CYTHON_INLINE {{TYPE}} {{FROM_PY_FUNCTION}}(PyObject *x) {
const
digit
*
digits
=
((
PyLongObject
*
)
x
)
->
ob_digit
;
switch
(
Py_SIZE
(
x
))
{
case
0
:
return
({{
TYPE
}})
0
;
case
-
1
:
__PYX_VERIFY_RETURN_INT
({{
TYPE
}},
sdigit
,
-
(
sdigit
)
digits
[
0
])
case
-
1
:
__PYX_VERIFY_RETURN_INT
({{
TYPE
}},
sdigit
,
(
sdigit
)
-
digits
[
0
])
case
1
:
__PYX_VERIFY_RETURN_INT
({{
TYPE
}},
digit
,
+
digits
[
0
])
{{
for
_size
in
(
2
,
3
,
4
)}}
{{
for
_case
in
(
-
_size
,
_size
)}}
...
...
This diff is collapsed.
Click to expand it.
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