Math.floor.js 432 B

12345678910111213141516171819
  1. load("test-common.js");
  2. try {
  3. assert(Math.floor(0.95) === 0);
  4. assert(Math.floor(4) === 4);
  5. assert(Math.floor(7.004) == 7);
  6. assert(Math.floor(-0.95) === -1);
  7. assert(Math.floor(-4) === -4);
  8. assert(Math.floor(-7.004) === -8);
  9. assert(isNaN(Math.floor()));
  10. assert(isNaN(Math.floor(NaN)));
  11. assert(Math.floor.length === 1);
  12. console.log("PASS");
  13. } catch (e) {
  14. console.log("FAIL: " + e);
  15. }