Skip to content

Commit d1aecc4

Browse files
committed
Write the test for math.hypot
1 parent 0cb4588 commit d1aecc4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

integration_tests/test_math.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from math import (factorial, isqrt, perm, comb, degrees, radians, exp, pow,
2-
ldexp, fabs, gcd, lcm, copysign)
2+
ldexp, fabs, gcd, lcm, copysign, hypot)
33
from ltypes import i32, f64
44

55

@@ -92,6 +92,16 @@ def test_copysign():
9292
assert f == -43.0
9393

9494

95+
def test_hypot():
96+
f: f64
97+
f = hypot(3, 4)
98+
assert f == 5.0
99+
f = hypot(-3, 4)
100+
assert f == 5.0
101+
f = hypot(6, 6)
102+
assert f == 8.485281374238571
103+
104+
95105
test_factorial_1()
96106
test_comb()
97107
test_isqrt()
@@ -105,3 +115,4 @@ def test_copysign():
105115
test_gcd()
106116
test_lcm()
107117
test_copysign()
118+
test_hypot()

0 commit comments

Comments
 (0)