diff --git a/core/kernel/Float_spec.rb b/core/kernel/Float_spec.rb index e00fe8157..bb9473223 100644 --- a/core/kernel/Float_spec.rb +++ b/core/kernel/Float_spec.rb @@ -257,6 +257,10 @@ def to_f() 1.2 end @object.send(:Float, "0x_10", exception: false).should be_nil end + it "parses negative hexadecimal string as negative float" do + @object.send(:Float, "-0x7b").should == -123.0 + end + ruby_version_is "3.4" do it "accepts a fractional part" do @object.send(:Float, "0x0.8").should == 0.5