We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8722181 commit 9f50458Copy full SHA for 9f50458
1 file changed
spec/ruby/core/kernel/Float_spec.rb
@@ -222,6 +222,18 @@ def to_f() 1.2 end
222
end
223
224
225
+ describe "for hexidecimal literals" do
226
+ it "interprets positive hex value" do
227
+ @object.send(:Float, "0x10").should == 16.0
228
+ @object.send(:Float, "0X10").should == 16.0
229
+ end
230
+
231
+ it "interprets negative hex value" do
232
+ @object.send(:Float, "-0x10").should == -16.0
233
+ @object.send(:Float, "-0X10").should == -16.0
234
235
236
237
describe "for hexadecimal literals with binary exponent" do
238
%w(p P).each do |p|
239
it "interprets the fractional part (on the left side of '#{p}') in hexadecimal" do
0 commit comments