Skip to content

Commit b6c3d42

Browse files
committed
add TODO to missing powInt tests
1 parent 30f18b6 commit b6c3d42

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

tests/math.test.ts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,34 @@ describe("math functions", () => {
3434
});
3535

3636
it("pow (integer exponent)", () => {
37+
// Exponent = 0
38+
assert.deepEqual(nsf.powInt(uint(5, 5), 0), uint(1, 1));
39+
40+
// Exponent = 1
41+
// TODO
42+
43+
// Exponent = 2
3744
assert.deepEqual(nsf.powInt(uint(-inf, 0), 2), uint(0, inf));
3845
assert.deepEqual(nsf.powInt(uint(-2, 2), 2), uint(0, next(4)));
3946
assert.deepEqual(nsf.powInt(uint(1, 2), 2), uint(prev(1), next(4)));
47+
assert.deepEqual(nsf.powInt(uint(-3, 5), 2), uint(0, next(25)));
48+
assert.deepEqual(nsf.powInt(uint(0, 5), 2), uint(0, next(25)));
49+
assert.deepEqual(nsf.powInt(uint(3, 5), 2), uint(prev(9), next(25)));
50+
assert.deepEqual(nsf.powInt(uint(-3, 1), 2), uint(0, next(9)));
4051

52+
// Exponent = 3
4153
assert.deepEqual(nsf.powInt(uint(-inf, 0), 3), uint(-inf, 0));
4254
assert.deepEqual(nsf.powInt(uint(-2, 2), 3), uint(prev(-8), next(8)));
4355
assert.deepEqual(nsf.powInt(uint(1, 2), 3), uint(prev(1), next(8)));
4456

45-
assert.deepEqual(nsf.powInt(uint(5, 5), 0), uint(1, 1));
46-
assert.deepEqual(nsf.powInt(uint(-3, 5), 2), uint(0, next(25)));
47-
assert.deepEqual(nsf.powInt(uint(0, 5), 2), uint(0, next(25)));
48-
assert.deepEqual(nsf.powInt(uint(3, 5), 2), uint(prev(9), next(25)));
49-
assert.deepEqual(nsf.powInt(uint(-3, 1), 2), uint(0, next(9)));
57+
// Exponent = -1
58+
// TODO
59+
60+
// Exponent = -2
61+
// TODO
5062

51-
// TODO negative exponent
63+
// Exponent = -3
64+
// TODO
5265
});
5366

5467
it("pow (union exponent)", () => {

0 commit comments

Comments
 (0)