From 501f7f6027b99416b94f093bb30691c5ae43d7d0 Mon Sep 17 00:00:00 2001 From: Yukihiro Matsumoto Date: Tue, 5 Jun 2012 09:09:50 +0900 Subject: stop introducing Math::TORELANCE --- test/assert.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/assert.rb b/test/assert.rb index 239730cb9..5cca59187 100644 --- a/test/assert.rb +++ b/test/assert.rb @@ -74,12 +74,12 @@ 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 a = a.to_f b = b.to_f if a.finite? and b.finite? - (a-b).abs < Math::TOLERANCE + (a-b).abs < tolerance else true end end - -- cgit v1.2.3