Sha256: 2fe1adde0c3ca205baa394a334824b9e00b6ea41b3cda7e750af2b33e8fec511

Contents?: true

Size: 352 Bytes

Versions: 33

Compression:

Stored size: 352 Bytes

Contents

describe "String#to_f" do
  it "treats leading characters of self as a floating point number" do
    "45.67 degress".to_f.should == 45.67
    "0".to_f.should == 0.0

    ".5".to_f.should == 0.5
    "5e".to_f.should == 5.0
    "5E".to_f.should == 5.0
  end

  it "treats special float value strings as characters" do
    "NaN".to_f.should == 0
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
opal-0.5.5 spec/opal/core/string/to_f_spec.rb
opal-0.5.4 spec/corelib/string/to_f_spec.rb
opal-0.5.2 spec/corelib/string/to_f_spec.rb
opal-0.5.0 spec/corelib/string/to_f_spec.rb
opal-0.4.4 spec/rubyspec/core/string/to_f_spec.rb
opal-0.4.3 spec/rubyspec/core/string/to_f_spec.rb
opal-0.4.2 spec/rubyspec/core/string/to_f_spec.rb
opal-0.4.1 spec/rubyspec/core/string/to_f_spec.rb
opal-0.4.0 spec/rubyspec/core/string/to_f_spec.rb
opal-0.3.44 spec/rubyspec/core/string/to_f_spec.rb
opal-0.3.43 spec/rubyspec/core/string/to_f_spec.rb
opal-0.3.42 spec/core/string/to_f_spec.rb
opal-0.3.41 spec/core/string/to_f_spec.rb
opal-0.3.40 spec/core/string/to_f_spec.rb
opal-0.3.39 spec/core/string/to_f_spec.rb
opal-0.3.38 spec/core/string/to_f_spec.rb
opal-0.3.37 spec/core/string/to_f_spec.rb
opal-0.3.36 spec/core/string/to_f_spec.rb
opal-0.3.35 spec/core/string/to_f_spec.rb
opal-0.3.34 spec/core/string/to_f_spec.rb