@antv/util
Version:
<h1 align="center">@antv/util</h1>
13 lines • 438 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = isNumberEqual;
var PRECISION = 0.00001; // numbers less than this is considered as 0
/**
* 判断两个数是否相等
* @return 是否相等
*/
function isNumberEqual(a, b, precision) {
if (precision === void 0) { precision = PRECISION; }
return a === b || Math.abs(a - b) < precision;
}
//# sourceMappingURL=is-number-equal.js.map
;