1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:37:36 +00:00

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

This commit is contained in:
davidot 2022-11-28 12:08:57 +01:00 committed by Andreas Kling
parent 8de8742b7c
commit bf1b2d63c6
2 changed files with 13 additions and 2 deletions

View file

@ -5,4 +5,6 @@ test("basic functionality", () => {
expect(Math.tanh(Infinity)).toBe(1);
expect(Math.tanh(-Infinity)).toBe(-1);
expect(Math.tanh(1)).toBeCloseTo(0.7615941559557649);
expect(Math.tanh(NaN)).toBe(NaN);
expect(Math.tanh(-0.0)).toBe(-0.0);
});