Skip to content

Commit

Permalink
Splitting up these tests also for better debugging.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Sep 7, 2014
1 parent 846e5cb commit 86db61a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,16 @@ describe('Math', function() {
});

describe('#log2()', function() {
it('should be correct', function() {
it('should be correct for edge cases', function() {
expect(Number.isNaN(Math.log2(NaN))).to.be.ok;
expect(Number.isNaN(Math.log2(-1e-50))).to.be.ok;
expect(Math.log2(+0)).to.equal(-Infinity);
expect(Math.log2(-0)).to.equal(-Infinity);
expect(isPositiveZero(Math.log2(1))).to.be.ok;
expect(Math.log2(Infinity)).to.equal(Infinity);
});

it('should have the right precision', function() {
expect(Math.log2(5)).to.almostEqual(2.321928094887362);
expect(Math.log2(32)).to.almostEqual(5);
});
Expand Down

0 comments on commit 86db61a

Please sign in to comment.