diff options
Diffstat (limited to 'spec/ruby/core/math/ldexp_spec.rb')
-rw-r--r-- | spec/ruby/core/math/ldexp_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/core/math/ldexp_spec.rb b/spec/ruby/core/math/ldexp_spec.rb index fb7799cf26..6dcf94a663 100644 --- a/spec/ruby/core/math/ldexp_spec.rb +++ b/spec/ruby/core/math/ldexp_spec.rb @@ -45,6 +45,12 @@ describe "Math.ldexp" do it "accepts any second argument that can be coerced with Integer()" do Math.ldexp(3.23, MathSpecs::Integer.new).should be_close(12.92, TOLERANCE) end + + it "returns correct value that closes to the max value of double type" do + Math.ldexp(0.5122058490966879, 1024).should == 9.207889385574391e+307 + Math.ldexp(0.9999999999999999, 1024).should == 1.7976931348623157e+308 + Math.ldexp(0.99999999999999999, 1024).should == Float::INFINITY + end end describe "Math#ldexp" do |