Skip to content

Instantly share code, notes, and snippets.

@wallace
Created March 14, 2017 13:02
Show Gist options
  • Select an option

  • Save wallace/a8d50c87ae3c1f139182dc7b51d9d8dc to your computer and use it in GitHub Desktop.

Select an option

Save wallace/a8d50c87ae3c1f139182dc7b51d9d8dc to your computer and use it in GitHub Desktop.

Revisions

  1. wallace created this gist Mar 14, 2017.
    18 changes: 18 additions & 0 deletions bigdecimaltest.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #### RUBY 2.3 ####
    2017-03-14 08:59:51 |2.3.1| MBP1516W1R7sMBP in ~/Documents/projects irb
    [1] pry(main)> require 'bigdecimal'
    => true
    [2] pry(main)> BigDecimal.new("")
    => #<BigDecimal:7fd10c18e518,'0.0',9(9)>
    [3] pry(main)>


    #### RUBY 2.4 ####
    irb(main):003:0> require 'bigdecimal'
    => true
    irb(main):004:0> BigDecimal.new("")
    ArgumentError: invalid value for BigDecimal(): ""
    from (irb):4:in `initialize'
    from (irb):4:in `new'
    from (irb):4
    from /Users/jonathanwallace/.rbenv/versions/2.4.0/bin/irb:11:in `<main>'