我选择的epsilon是否适合这些情况?true : Math.abs(a - b) < EPSILON;
* Returns true if two doubles are considered equal.Test if the difference of first minus second is greater then
此方法使用以下公式计算a和b之间的相对epsilon:默认情况下,rel_tol设置为1e-09。a=1234.000001
# the relative epsilon, as calculated with the above formula, would be 0.000001234000001但是,由于相对epsilon比1e-06稍大,这就是区别,它返回true。我在几个地方见过这个相对的epsilon公式,但从来没有解释过为什