Math.tan.js 465 B

123456789101112131415161718
  1. load("test-common.js");
  2. try {
  3. assert(Math.tan(0) === 0);
  4. assert(Math.tan(null) === 0);
  5. assert(Math.tan('') === 0);
  6. assert(Math.tan([]) === 0);
  7. assert(Math.ceil(Math.tan(Math.PI / 4)) === 1);
  8. assert(isNaN(Math.tan()));
  9. assert(isNaN(Math.tan(undefined)));
  10. assert(isNaN(Math.tan([1, 2, 3])));
  11. assert(isNaN(Math.tan({})));
  12. assert(isNaN(Math.tan("foo")));
  13. console.log("PASS");
  14. } catch (e) {
  15. console.log("FAIL: " + e);
  16. }