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
commit f5dacfbb5b
Notes: sideshowbarker 2024-07-19 07:52:00 +09:00
5 changed files with 79 additions and 0 deletions

View file

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