Skip to content

Commit 7bb250c

Browse files
author
Aastha Singh
committed
Add test for modf()
1 parent cebf9b0 commit 7bb250c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

integration_tests/test_math.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from math import (factorial, isqrt, perm, comb, degrees, radians, exp, pow,
2-
ldexp, fabs, gcd, lcm, floor, ceil, remainder, expm1, fmod, log1p, trunc)
2+
ldexp, fabs, gcd, lcm, floor, ceil, remainder, expm1, fmod, log1p, trunc,
3+
modf)
34
from ltypes import i32, f64, i64
45

56
eps: f64
@@ -149,6 +150,14 @@ def test_trunc():
149150
i = trunc(-4.5)
150151
assert i == -4
151152

153+
def test_modf():
154+
i: f64
155+
i = 3.14
156+
157+
res: tuple[f64, i32]
158+
res = modf(i)
159+
assert res[0] == 0.14000000000000012
160+
assert res[1] == 3
152161

153162
def check():
154163
test_factorial_1()
@@ -170,6 +179,6 @@ def check():
170179
test_expm1()
171180
test_log1p()
172181
test_trunc()
173-
182+
test_modf()
174183

175184
check()

0 commit comments

Comments
 (0)