Created
November 23, 2011 15:14
-
-
Save clemens/1388927 to your computer and use it in GitHub Desktop.
Ruby 1.9.3 BigDecimal bug?
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 | |
>> require 'bigdecimal/util' | |
=> true | |
>> BigDecimal('40.30') == 40.3 | |
=> true | |
>> BigDecimal('40.90') == 40.9 | |
=> true | |
>> BigDecimal('40.10') == 40.1 | |
=> true | |
>> BigDecimal('49.10') == 49.1 | |
=> true | |
>> BigDecimal('69.10') == 69.1 | |
=> false | |
# WTF?! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, I see. :(
On the positive side: They've finally added to_d to BigDecimal itself (!) and Integer. I used to have to monkeypatch these ... :)
Anyway, thanks for the hints – I'll fix that some other way, then, I guess.