Move Math::TOLERANCE to mruby-math

This commit is contained in:
Daniel Bovensiepen
2013-02-28 15:20:46 +00:00
parent 12af04011f
commit 81f96cb9af
2 changed files with 131 additions and 121 deletions
+1 -2
View File
@@ -151,9 +151,8 @@ end
##
# Performs fuzzy check for equality on methods returning floats
# on the basis of the Math::TOLERANCE constant.
def check_float(a, b)
tolerance = Math::TOLERANCE
tolerance = 1e-12
a = a.to_f
b = b.to_f
if a.finite? and b.finite?