[前][次][番号順一覧][スレッド一覧]

ruby-changes:66366

From: Jeremy <ko1@a...>
Date: Sun, 30 May 2021 06:11:09 +0900 (JST)
Subject: [ruby-changes:66366] fd65ef2a5a (master): Attempt to fix floating point test failure

https://git.ruby-lang.org/ruby.git/commit/?id=fd65ef2a5a

From fd65ef2a5aa8629676d1edb6410e4d4cf60b8045 Mon Sep 17 00:00:00 2001
From: Jeremy Evans <code@j...>
Date: Sat, 29 May 2021 14:08:24 -0700
Subject: Attempt to fix floating point test failure

The previous behavior depending on exact float values, it seemed
to work OK on amd64 and i386, but other CI platforms are
experiencing non-deterministic test failures with it. Relax test
slightly to hopefully pass on such platforms.
---
 test/ruby/test_float.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb
index ca61645..4be2cfe 100644
--- a/test/ruby/test_float.rb
+++ b/test/ruby/test_float.rb
@@ -898,7 +898,7 @@ class TestFloat < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_float.rb#L898
       a = rand
       b = a+rand*1000
       s = (b - a) / 10
-      b = a + s*10
+      b = a + s*9.999999
       seq = (a...b).step(s)
       assert_equal(10, seq.to_a.length, seq.inspect)
     end
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]