Number-constants.js 541 B

123456789101112131415
  1. try {
  2. assert(Number.EPSILON === 2 ** -52);
  3. assert(Number.EPSILON > 0);
  4. assert(Number.MAX_SAFE_INTEGER === 2 ** 53 - 1);
  5. assert(Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2);
  6. assert(Number.MIN_SAFE_INTEGER === -(2 ** 53 - 1));
  7. assert(Number.MIN_SAFE_INTEGER - 1 === Number.MIN_SAFE_INTEGER - 2);
  8. assert(Number.POSITIVE_INFINITY === Infinity);
  9. assert(Number.NEGATIVE_INFINITY === -Infinity);
  10. assert(isNaN(Number.NaN));
  11. console.log("PASS");
  12. } catch (e) {
  13. console.log("FAIL: " + e);
  14. }