Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

math-trunc.js 284B

1234567891011
  1. 'use strict';
  2. var ceil = Math.ceil;
  3. var floor = Math.floor;
  4. // `Math.trunc` method
  5. // https://tc39.es/ecma262/#sec-math.trunc
  6. // eslint-disable-next-line es/no-math-trunc -- safe
  7. module.exports = Math.trunc || function trunc(x) {
  8. var n = +x;
  9. return (n > 0 ? floor : ceil)(n);
  10. };