From 7288403b9b0e3cc6193c5f563c7014a0c4f1f23f Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 29 Nov 2014 14:47:54 +0000 Subject: tests: Split out float test from builtin_round.py. --- tests/float/builtin_float_round.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/float/builtin_float_round.py (limited to 'tests/float') diff --git a/tests/float/builtin_float_round.py b/tests/float/builtin_float_round.py new file mode 100644 index 000000000..afde6ff16 --- /dev/null +++ b/tests/float/builtin_float_round.py @@ -0,0 +1,12 @@ +# 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)) -- cgit v1.2.3