1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

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

This commit is contained in:
davidot 2022-11-28 12:05:58 +01:00 committed by Andreas Kling
parent 4813385c9a
commit eda90b54d4
2 changed files with 23 additions and 3 deletions

View file

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