Math.cosh.js 561 B

12345678910111213141516171819
  1. describe("basic functionality", () => {
  2. test("length", () => {
  3. expect(Math.cosh).toHaveLength(1);
  4. });
  5. test("simple values", () => {
  6. expect(Math.cosh(1)).toBeCloseTo(1.5430806348152437);
  7. expect(Math.cosh(-1)).toBeCloseTo(1.5430806348152437);
  8. });
  9. test("special values", () => {
  10. expect(Math.cosh(0)).toBe(1);
  11. expect(Math.cosh(-0.0)).toBe(1);
  12. expect(Math.cosh(NaN)).toBeNaN();
  13. expect(Math.cosh(Infinity)).toBe(Infinity);
  14. expect(Math.cosh(-Infinity)).toBe(Infinity);
  15. });
  16. });