File tree Expand file tree Collapse file tree 1 file changed +22
-17
lines changed Expand file tree Collapse file tree 1 file changed +22
-17
lines changed Original file line number Diff line number Diff line change 2
2
ldexp , fabs , gcd , lcm )
3
3
from ltypes import i32 , f64
4
4
5
+ eps : f64
6
+ eps = 1e-12
5
7
6
8
def test_factorial_1 ():
7
9
i : i32
@@ -30,31 +32,31 @@ def test_isqrt():
30
32
def test_degrees ():
31
33
i : f64
32
34
i = degrees (32.2 )
33
- assert i == 1844.924100321251
35
+ assert abs ( i - 1844.924100321251 ) < eps
34
36
35
37
36
38
def test_radians ():
37
39
i : f64
38
40
i = radians (100.1 )
39
- assert i == 1.7470745812463238
41
+ assert abs ( i - 1.7470745812463238 ) < eps
40
42
41
43
42
44
def test_exp ():
43
45
i : f64
44
46
i = exp (2.34 )
45
- assert i == 10.381236562731843
47
+ assert abs ( i - 10.381236562731843 ) < eps
46
48
47
49
48
50
def test_pow ():
49
51
i : f64
50
52
i = pow (2.4 , 4.3 )
51
- assert i == 43.14280115650323
53
+ assert abs ( i - 43.14280115650323 ) < eps
52
54
53
55
54
56
def test_ldexp ():
55
57
i : f64
56
58
i = ldexp (23.3 , 2 )
57
- assert i == 93.2
59
+ assert abs ( i - 93.2 ) < eps
58
60
59
61
60
62
def test_fabs ():
@@ -84,15 +86,18 @@ def test_lcm():
84
86
assert i == 84
85
87
86
88
87
- test_factorial_1 ()
88
- test_comb ()
89
- test_isqrt ()
90
- test_perm ()
91
- test_degrees ()
92
- test_radians ()
93
- test_exp ()
94
- test_pow ()
95
- test_fabs ()
96
- test_ldexp ()
97
- test_gcd ()
98
- test_lcm ()
89
+ def check ():
90
+ test_factorial_1 ()
91
+ test_comb ()
92
+ test_isqrt ()
93
+ test_perm ()
94
+ test_degrees ()
95
+ test_radians ()
96
+ test_exp ()
97
+ test_pow ()
98
+ test_fabs ()
99
+ test_ldexp ()
100
+ test_gcd ()
101
+ test_lcm ()
102
+
103
+ check ()
You can’t perform that action at this time.
0 commit comments