@juici/math
Version:
A mathematics utility library
17 lines (14 loc) • 355 B
text/typescript
import { BigDecimal } from "../../BigDecimal";
test("neg", () => {
const cases: Array<[string, string]> = [
["-1", "1"],
["0", "0"],
["0.5", "-0.5"],
];
for (const [a, b] of cases) {
const x = new BigDecimal(a);
const y = new BigDecimal(b);
expect(x.neg()).toEqualDecimal(y);
expect(y.neg()).toEqualDecimal(x);
}
});