mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18:13 +00:00
LibJS: Add Math.{cos,sin,tan}()
This commit is contained in:
parent
04a36b247b
commit
f5dacfbb5b
5 changed files with 79 additions and 0 deletions
17
Libraries/LibJS/Tests/Math.sin.js
Normal file
17
Libraries/LibJS/Tests/Math.sin.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
try {
|
||||
assert(Math.sin(0) === 0);
|
||||
assert(Math.sin(null) === 0);
|
||||
assert(Math.sin('') === 0);
|
||||
assert(Math.sin([]) === 0);
|
||||
assert(Math.sin(Math.PI * 3 / 2) === -1);
|
||||
assert(Math.sin(Math.PI / 2) === 1);
|
||||
assert(isNaN(Math.sin()));
|
||||
assert(isNaN(Math.sin(undefined)));
|
||||
assert(isNaN(Math.sin([1, 2, 3])));
|
||||
assert(isNaN(Math.sin({})));
|
||||
assert(isNaN(Math.sin("foo")));
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue