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
Boxiang Sun
cython
Commits
bfdb44e5
Commit
bfdb44e5
authored
Jan 06, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test 'unsigned long' against maxint+1 to avoid dependency on real long size
parent
10b330fe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
tests/run/r_vree_1.pyx
tests/run/r_vree_1.pyx
+17
-6
No files found.
tests/run/r_vree_1.pyx
View file @
bfdb44e5
...
@@ -3,15 +3,26 @@ __doc__ = """
...
@@ -3,15 +3,26 @@ __doc__ = """
0L
0L
>>> test(1)
>>> test(1)
1L
1L
>>> 2**36
68719476736L
>>> import sys
>>> test(2**36)
>>> sys.maxint + 1 > sys.maxint
0L
True
>>> test(2L**36)
>>> type(sys.maxint * 2 + 1) is long
0L
True
>>> test(sys.maxint + 1)
2147483648L
>>> test(sys.maxint * 2 + 1)
4294967295L
>>> test(8 ** unsigned_long_size() - 1) > sys.maxint
True
"""
"""
def
test
(
k
):
def
test
(
k
):
cdef
unsigned
long
m
cdef
unsigned
long
m
m
=
k
m
=
k
return
m
return
m
def
unsigned_long_size
():
return
sizeof
(
unsigned
long
)
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