shfshanyue / blog

在这里写一些工作中遇到的前端,后端以及运维的问题

Home Page:https://shanyue.tech

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

equal fn有误

givebest opened this issue · comments

function equal (a, b) { return Math.abs(a, b) < Number.EPSILON }
return 处应为:
return Math.abs(a - b) < Number.EPSILON

@see https://github.com/getify/You-Dont-Know-JS/blob/master/types%20%26%20grammar/ch2.md#small-decimal-values

手误,非常感谢!