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.
13 lines
438 B
13 lines
438 B
"use strict";
|
|
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
|