summaryrefslogtreecommitdiffhomepage
path: root/test/assert.rb
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-08-01 01:12:09 +0900
committerYukihiro Matsumoto <[email protected]>2012-08-01 01:12:09 +0900
commit34cf05679c5ce9ee40be6bd4ccace0ec94fcebdf (patch)
tree0b25a902781b56e13c517dcbdd8ce4795b08a524 /test/assert.rb
parentcde3c35666c0617bfcc705aa83b7a679ec83569c (diff)
downloadmruby-34cf05679c5ce9ee40be6bd4ccace0ec94fcebdf.tar.gz
mruby-34cf05679c5ce9ee40be6bd4ccace0ec94fcebdf.zip
add Math::TOLERANCE
Diffstat (limited to 'test/assert.rb')
-rw-r--r--test/assert.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/assert.rb b/test/assert.rb
index 9329638c9..89e820a00 100644
--- a/test/assert.rb
+++ b/test/assert.rb
@@ -81,7 +81,7 @@ end
# Performs fuzzy check for equality on methods returning floats
# on the basis of the Math::TOLERANCE constant.
def check_float(a, b)
- tolerance = 1e-12
+ tolerance = Math::TOLERANCE
a = a.to_f
b = b.to_f
if a.finite? and b.finite?
@@ -90,4 +90,3 @@ def check_float(a, b)
true
end
end
-