LibJS: Add spec comments and check for edge cases in Math.log10

This commit is contained in:
davidot 2022-11-28 12:06:50 +01:00 committed by Andreas Kling
commit 4306462a95
Notes: sideshowbarker 2024-07-17 03:59:11 +09:00
2 changed files with 23 additions and 3 deletions

View file

@ -6,4 +6,7 @@ test("basic functionality", () => {
expect(Math.log10(0)).toBe(-Infinity);
expect(Math.log10(-2)).toBe(NaN);
expect(Math.log10(100000)).toBe(5);
expect(Math.log10(NaN)).toBe(NaN);
expect(Math.log10(Number.POSITIVE_INFINITY)).toBe(Number.POSITIVE_INFINITY);
expect(Math.log10(-0.0)).toBe(Number.NEGATIVE_INFINITY);
});