[PATCH] possible Float#to_s bug
Reported by Jeremy Roach | December 23rd, 2007 @ 03:03 AM | in 1.0 preview
1.87687113714737e-40.to_s == "1.87687113714737e-40"
This evaluates to true in mri, but false in rubinius. Rubinius appears to strip the trailing zero from the string.
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
rubinius 0.8.0 (ruby 1.8.6 compatible) (eea90994f) (12/22/2007) [i686-pc-linux-gnu]
Comments and changes to this ticket
-

Brandon Mitchell January 2nd, 2008 @ 04:40 PM
The 'e' is getting sucked into \1 in the regexp. The attached patch seems to fix the problem, for me.
-

Brandon Mitchell January 2nd, 2008 @ 04:46 PM
- → Title changed from possible Float#to_s bug to [PATCH] possible Float#to_s bug
-
Brian Ford January 5th, 2008 @ 01:23 PM
- → State changed from new to resolved
Committed in 7b57b3ac6. Thanks!
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
