Skip to content

Commit a351bd5

Browse files
committed
Write the test for math.copysign
1 parent e709f9f commit a351bd5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

integration_tests/test_math.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ def test_lcm():
8484
assert i == 84
8585

8686

87+
def test_copysign():
88+
f: f64
89+
f = copysign(4, -1)
90+
assert f == -4.0
91+
f = copysign(-8, 97.21)
92+
assert f == 8.0
93+
f = copysign(0, -1)
94+
assert f == -0.0
95+
f = copysign(-43, -76)
96+
assert f == -43.0
97+
98+
8799
test_factorial_1()
88100
test_comb()
89101
test_isqrt()
@@ -96,3 +108,4 @@ def test_lcm():
96108
test_ldexp()
97109
test_gcd()
98110
test_lcm()
111+
test_copysign()

0 commit comments

Comments
 (0)