Skip to content

Commit

Permalink
Split up Math.expm1 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Feb 4, 2015
1 parent 2219236 commit da7b99e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/math.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,21 @@ describe('Math', function () {
});

describe('#expm1()', function () {
it('should be correct', function () {
it('should be correct for NaN', function () {
expect(Number.isNaN(Math.expm1(NaN))).to.equal(true);
});

it('should be correct for zeroes', function () {
expect(isPositiveZero(Math.expm1(+0))).to.equal(true);
expect(isNegativeZero(Math.expm1(-0))).to.equal(true);
});

it('should be correct for Infinity', function () {
expect(Math.expm1(Infinity)).to.equal(Infinity);
expect(Math.expm1(-Infinity)).to.equal(-1);
});

it('should be correct for arbitrary numbers', function () {
expect(Math.expm1(10)).to.almostEqual(22025.465794806718);
expect(Math.expm1(-10)).to.almostEqual(-0.9999546000702375);
expect(Math.expm1(-2e-17)).to.equal(-2e-17);
Expand Down

0 comments on commit da7b99e

Please sign in to comment.