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
bf456a14
Commit
bf456a14
authored
Mar 25, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests for floating point for..from steps (#254)
parent
087d29ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
tests/run/for_from_float_T254.pyx
tests/run/for_from_float_T254.pyx
+60
-0
No files found.
tests/run/for_from_float_T254.pyx
0 → 100644
View file @
bf456a14
__doc__
=
u"""
>>> double_target(0, 4)
at 0.0
at 1.0
at 2.0
at 3.0
4.0
>>> double_step(0, 2, .5)
at 0.0
at 0.5
at 1.0
at 1.5
2.0
>>> double_step_typed(0, 2, .5)
at 0.0
at 0.5
at 1.0
at 1.5
2.0
>>> double_step_py_target(0, 2, .5)
at 0.0
at 0.5
at 1.0
at 1.5
2.0
>>> int_step_py_target(0, 2, 1)
at 0
at 1
2
"""
def
double_target
(
a
,
b
):
cdef
double
x
for
x
from
a
<=
x
<
b
:
print
"at"
,
x
return
x
def
double_step
(
a
,
b
,
dx
):
cdef
double
x
for
x
from
a
<=
x
<
b
by
dx
:
print
"at"
,
x
return
x
def
double_step_typed
(
a
,
b
,
double
dx
):
cdef
double
x
for
x
from
a
<=
x
<
b
by
dx
:
print
"at"
,
x
return
x
def
double_step_py_target
(
a
,
b
,
double
dx
):
cdef
object
x
for
x
from
a
<=
x
<
b
by
dx
:
print
"at"
,
x
return
x
def
int_step_py_target
(
a
,
b
,
int
dx
):
cdef
object
x
for
x
from
a
<=
x
<
b
by
dx
:
print
"at"
,
x
return
x
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