asd/asd-wx/node_modules/core-js/internals/math-trunc.js

11 lines
272 B
JavaScript
Raw Normal View History

2024-11-21 11:32:11 +08:00
var ceil = Math.ceil;
var floor = Math.floor;
// `Math.trunc` method
// https://tc39.es/ecma262/#sec-math.trunc
// eslint-disable-next-line es-x/no-math-trunc -- safe
module.exports = Math.trunc || function trunc(x) {
var n = +x;
return (n > 0 ? floor : ceil)(n);
};