Skip to content

Commit 0c5ea37

Browse files
committed
Write the test for round built-in function
1 parent 73b0a89 commit 0c5ea37

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from ltypes import f64
2+
3+
def test_round():
4+
f: f64
5+
f = 5.678
6+
print(round(f))
7+
assert round(f) == 6
8+
f = -183745.23
9+
print(round(f))
10+
assert round(f) == -183745
11+
f = 44.34
12+
print(round(f))
13+
assert round(f) == 44
14+
assert round(13.001) == 13
15+
assert round(-40.49999) == -40
16+
17+
18+
test_round()

0 commit comments

Comments
 (0)