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
e9f67ac2
Commit
e9f67ac2
authored
Dec 03, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test for ticket 236
parent
ec3ee680
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
tests/run/c_type_methods_T236.pyx
tests/run/c_type_methods_T236.pyx
+41
-0
No files found.
tests/run/c_type_methods_T236.pyx
0 → 100644
View file @
e9f67ac2
__doc__
=
''
import
sys
if
sys
.
version_info
>=
(
2
,
6
):
__doc__
=
'''
>>> float_is_integer(1.0)
True
>>> float_is_integer(1.1)
False
'''
if
sys
.
version_info
>=
(
3
,
1
):
__doc__
=
'''
>>> int_bit_length(1) == (1).bit_length()
True
>>> int_bit_length(1234) == (1234).bit_length()
True
'''
def
float_is_integer
(
float
f
):
# requires Python 2.6+
return
f
.
is_integer
()
def
int_bit_length
(
int
i
):
# requires Python 3.x
return
i
.
bit_length
()
def
float__add__
(
float
f
):
"""
>>> float__add__(5.0)
7.0
"""
return
f
.
__add__
(
2
)
def
int__add__
(
int
i
):
"""
>>> int__add__(5)
7
"""
return
i
.
__add__
(
2
)
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