Damien George | 7288403 | 2014-11-29 14:47:54 +0000 | [diff] [blame] | 1 | # test round() with floats |
2 | |||||
3 | # check basic cases | ||||
4 | tests = [ | ||||
5 | 0.0, 1.0, 0.1, -0.1, 123.4, 123.6, -123.4, -123.6 | ||||
6 | ] | ||||
7 | for t in tests: | ||||
8 | print(round(t)) | ||||
9 | |||||
10 | # check .5 cases | ||||
11 | for i in range(11): | ||||
12 | print(round((i - 5) / 2)) |