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

LibJS: Add Math.{cos,sin,tan}()

This commit is contained in:
Linus Groh 2020-04-05 21:21:33 +01:00 committed by Andreas Kling
parent 04a36b247b
commit f5dacfbb5b
5 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,16 @@
try {
assert(Math.cos(0) === 1);
assert(Math.cos(null) === 1);
assert(Math.cos('') === 1);
assert(Math.cos([]) === 1);
assert(Math.cos(Math.PI) === -1);
assert(isNaN(Math.cos()));
assert(isNaN(Math.cos(undefined)));
assert(isNaN(Math.cos([1, 2, 3])));
assert(isNaN(Math.cos({})));
assert(isNaN(Math.cos("foo")));
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);
}