Skip to content

Commit 1b8e211

Browse files
eneboheadius
authored andcommitted
Add specs for basic bare hex float strings (sans pP)
1 parent c6fa667 commit 1b8e211

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/kernel/Float_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ def to_f() 1.2 end
231231
@object.send(:Float, "0x0f").should == 15.0
232232
end
233233

234+
it "interprets negative hex value" do
235+
@object.send(:Float, "-0x10").should == -16.0
236+
end
237+
234238
it "accepts embedded _ if the number does not contain a-f" do
235239
@object.send(:Float, "0x1_0").should == 16.0
236240
end

0 commit comments

Comments
 (0)