Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 153344e

Browse files
committed
Some examples showing how we deviate from IEEE 754 remainder
1 parent c2da07e commit 153344e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/remainder.test.js

+13
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,16 @@ describe("examples from the General Decimal Arithmetic Specification", () => {
127127
).toStrictEqual("1.0");
128128
});
129129
});
130+
131+
describe("not the same as IEEE 754 remainder", () => {
132+
test("42 % 10", () => {
133+
expect(
134+
new Decimal128("42").remainder(new Decimal128("10")).toString()
135+
).toStrictEqual("2");
136+
});
137+
test("46 % 10", () => {
138+
expect(
139+
new Decimal128("46").remainder(new Decimal128("10")).toString()
140+
).toStrictEqual("6");
141+
});
142+
});

0 commit comments

Comments
 (0)