math.js 911 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*!
  2. {
  3. "name": "ES6 Math",
  4. "property": "es6math",
  5. "notes": [{
  6. "name": "unofficial ECMAScript 6 draft specification",
  7. "href": "https://web.archive.org/web/20180825202128/https://tc39.github.io/ecma262/"
  8. }],
  9. "polyfills": ["es6shim"],
  10. "authors": ["Ron Waldon (@jokeyrhyme)"],
  11. "warnings": ["ECMAScript 6 is still a only a draft, so this detect may not match the final specification or implementations."],
  12. "tags": ["es6"]
  13. }
  14. !*/
  15. /* DOC
  16. Check if browser implements ECMAScript 6 Math per specification.
  17. */
  18. define(['Modernizr'], function(Modernizr) {
  19. Modernizr.addTest('es6math', !!(Math &&
  20. Math.clz32 &&
  21. Math.cbrt &&
  22. Math.imul &&
  23. Math.sign &&
  24. Math.log10 &&
  25. Math.log2 &&
  26. Math.log1p &&
  27. Math.expm1 &&
  28. Math.cosh &&
  29. Math.sinh &&
  30. Math.tanh &&
  31. Math.acosh &&
  32. Math.asinh &&
  33. Math.atanh &&
  34. Math.hypot &&
  35. Math.trunc &&
  36. Math.fround));
  37. });