Sha256: 4405a6df53182240516df37b26de694e66091eb62c0e8b7489dd2221f89d0b57
Contents?: true
Size: 1009 Bytes
Versions: 33
Compression:
Stored size: 1009 Bytes
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' describe "Float#to_s" do it "returns a string representation of self, possibly Nan, -Infinity, +Infinity" do 0.551e7.to_s.should == "5510000.0" -3.14159.to_s.should == "-3.14159" 0.0.to_s.should == "0.0" 1000000000000.to_f.to_s.should == "1000000000000.0" 10000000000000.to_f.to_s.should == "10000000000000.0" -10000000000000.to_f.to_s.should == "-10000000000000.0" 1.87687113714737e-40.to_s.should == "1.87687113714737e-40" (0.0 / 0.0).to_s.should == "NaN" (1.0 / 0.0).to_s.should == "Infinity" (-1.0 / 0.0).to_s.should == "-Infinity" 1.50505000e-20.to_s.should == "1.50505e-20" end it "returns a string representation of self" do 100000000000000.to_f.to_s.should == "1.0e+14" -100000000000000.to_f.to_s.should == "-1.0e+14" end platform_is_not :openbsd do it "returns the correct values for -0.0" do -0.0.to_s.should == "-0.0" end end end
Version data entries
33 entries across 33 versions & 1 rubygems