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.
10 lines
343 B
10 lines
343 B
var PRECISION = 0.00001; // numbers less than this is considered as 0
|
|
/**
|
|
* 判断两个数是否相等
|
|
* @return 是否相等
|
|
*/
|
|
export default 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
|