Commit 7288403b authored by Damien George's avatar Damien George
Browse files

tests: Split out float test from builtin_round.py.

parent 3b603f29
# test round()
# test round() with integral values
# check basic cases
tests = [
False, True,
0, 1, -1, 10,
0.0, 1.0, 0.1, -0.1, 123.4, 123.6, -123.4, -123.6
]
for t in tests:
print(round(t))
# check .5 cases
for i in range(11):
print(round((i - 5) / 2))
# test round() with floats
# check basic cases
tests = [
0.0, 1.0, 0.1, -0.1, 123.4, 123.6, -123.4, -123.6
]
for t in tests:
print(round(t))
# check .5 cases
for i in range(11):
print(round((i - 5) / 2))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment