Math.exp.js 419 B

12345678910111213
  1. test("basic functionality", () => {
  2. expect(Math.exp).toHaveLength(1);
  3. expect(Math.exp(0)).toBe(1);
  4. expect(Math.exp(-2)).toBeCloseTo(0.135335);
  5. expect(Math.exp(-1)).toBeCloseTo(0.367879);
  6. expect(Math.exp(1)).toBeCloseTo(2.718281);
  7. expect(Math.exp(2)).toBeCloseTo(7.389056);
  8. expect(Math.exp()).toBeNaN();
  9. expect(Math.exp(undefined)).toBeNaN();
  10. expect(Math.exp("foo")).toBeNaN();
  11. });