From 9f2378959e5c5b5c39c9993f1a84e5304ff113d6 Mon Sep 17 00:00:00 2001 From: Kenta Murata <3959+mrkn@users.noreply.github.com> Date: Mon, 26 Dec 2022 21:02:47 +0900 Subject: numeric.c: Fix round_half_even for specific values (#7023) Handle the integert and the float parts separately in round_half_even to prevent error occursions in floating point calculation. --- spec/ruby/core/float/round_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/ruby') diff --git a/spec/ruby/core/float/round_spec.rb b/spec/ruby/core/float/round_spec.rb index 50106025f9..e5a8f534e7 100644 --- a/spec/ruby/core/float/round_spec.rb +++ b/spec/ruby/core/float/round_spec.rb @@ -136,7 +136,7 @@ describe "Float#round" do -4.809999999999999.round(5, half: :even).should eql(-4.81) end - ruby_bug "", ""..."3.4" do + ruby_bug "", ""..."3.3" do # These numbers are neighbouring floating point numbers round a # precise value. They test that the rounding modes work correctly # round that value and precision is not lost which might cause -- cgit v1.2.3