mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-21 11:39:14 -04:00
Added new util function that sends tan function infinities correctly
Changed mathop to call new math util Changed sin & cos to round correctly (to get 0) Added testing for the new math util function Added testing for the new mathop functions
This commit is contained in:
parent
fff63e3af2
commit
1ac89f5aa4
4 changed files with 39 additions and 6 deletions
test/unit
|
@ -34,3 +34,11 @@ test('wrapClamp', function (t) {
|
|||
t.strictEqual(math.wrapClamp(100, 0, 10), 1);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('tan', function (t) {
|
||||
t.strictEqual(math.tan(90), Infinity);
|
||||
t.strictEqual(math.tan(180), 0);
|
||||
t.strictEqual(math.tan(-90), -Infinity);
|
||||
t.strictEqual(math.tan(33), 0.6494075932);
|
||||
t.end();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue