Rubby numeric handling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> require 'bigdecimal' | |
=> true | |
> Float('foo') | |
ArgumentError: invalid value for Float(): "foo" | |
from (irb):2:in `Float' | |
from (irb):2 | |
from /Users/mikep/.rubies/ruby-2.0.0-p353/bin/irb:12:in `<main>' | |
> Integer('foo') | |
ArgumentError: invalid value for Integer(): "foo" | |
from (irb):3:in `Integer' | |
from (irb):3 | |
from /Users/mikep/.rubies/ruby-2.0.0-p353/bin/irb:12:in `<main>' | |
> BigDecimal('foo') | |
=> #<BigDecimal:7fccf7178fb0,'0.0',9(9)> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment