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

ruby-changes:64805

From: Kenta <ko1@a...>
Date: Sat, 9 Jan 2021 22:07:07 +0900 (JST)
Subject: [ruby-changes:64805] 89f3125207 (master): [ruby/bigdecimal] Add test cases of conversion from Float

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

From 89f3125207de68f4b2d2a444a79b4e26b59cd9c9 Mon Sep 17 00:00:00 2001
From: Kenta Murata <mrkn@m...>
Date: Fri, 8 Jan 2021 21:00:45 +0900
Subject: [ruby/bigdecimal] Add test cases of conversion from Float

https://github.com/ruby/bigdecimal/commit/28d3836366

diff --git a/test/bigdecimal/test_bigdecimal_util.rb b/test/bigdecimal/test_bigdecimal_util.rb
index 3e3d9db..9c6973d 100644
--- a/test/bigdecimal/test_bigdecimal_util.rb
+++ b/test/bigdecimal/test_bigdecimal_util.rb
@@ -25,6 +25,8 @@ class TestBigDecimalUtil < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/bigdecimal/test_bigdecimal_util.rb#L25
     assert_equal(9.05, 9.05.to_d.to_f)
     assert_equal("9.050000000000001", 9.05.to_d.to_s('F'))
 
+    assert_equal(Math::PI, Math::PI.to_d.to_f)
+
     bug9214 = '[ruby-core:58858]'
     assert_equal((-0.0).to_d.sign, -1, bug9214)
 
@@ -50,6 +52,10 @@ class TestBigDecimalUtil < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/bigdecimal/test_bigdecimal_util.rb#L52
     assert_equal(64.4.to_d,
                  1.to_d * 64.4,
                  "[ruby-core:80234] [Bug #13331]")
+
+    assert_equal((2*Math::PI).to_d,
+                 2.to_d * Math::PI,
+                 "[ruby-core:80234] [Bug #13331]")
   end
 
   def test_Rational_to_d
-- 
cgit v0.10.2


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

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