Skip to content

Instantly share code, notes, and snippets.

@wallace
Created March 14, 2017 13:02
Show Gist options
  • Save wallace/a8d50c87ae3c1f139182dc7b51d9d8dc to your computer and use it in GitHub Desktop.
Save wallace/a8d50c87ae3c1f139182dc7b51d9d8dc to your computer and use it in GitHub Desktop.
ruby 2.4 vs 2.3 wrt BigDecimal
#### 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>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment