Math.expm1.js 477 B

12345678910111213141516171819
  1. load("test-common.js");
  2. try {
  3. assert(Math.expm1.length === 1);
  4. assert(Math.expm1(0) === 0);
  5. assert(isClose(Math.expm1(-2), -0.864664));
  6. assert(isClose(Math.expm1(-1), -0.632120));
  7. assert(isClose(Math.expm1(1), 1.718281));
  8. assert(isClose(Math.expm1(2), 6.389056));
  9. assert(isNaN(Math.expm1()));
  10. assert(isNaN(Math.expm1(undefined)));
  11. assert(isNaN(Math.expm1("foo")));
  12. console.log("PASS");
  13. } catch (e) {
  14. console.log("FAIL: " + e);
  15. }