142:574e0baea136 | 143:a689e0187ef5 |
---|---|
6 | 6 |
7 local m, e = math.frexp(3); | 7 local m, e = math.frexp(3); |
8 assert(m == 0.75 and e == 2, "frexp(3)"); | 8 assert(m == 0.75 and e == 2, "frexp(3)"); |
9 | 9 |
10 local m, e = math.frexp(-1); | 10 local m, e = math.frexp(-1); |
11 assert(m == -0.5 and e == 1, "frexp(1)"); | 11 assert(m == -0.5 and e == 1, "frexp(-1)"); |
12 | |
13 local m, e = math.frexp(0.5); | |
14 assert(m == 0.5 and e == 0, "frexp(0.5)"); | |
15 | |
16 local m, e = math.frexp(0.1); | |
17 assert(m == 0.8 and e == -3, "frexp(0.1)"); |