Bug #2483
closed
String#to_f of small numbers hangs
Added by mikisvaz (Miguel Vazquez) over 14 years ago.
Updated over 4 years ago.
Description
=begin
There is a problem in the String#to_f method. It hangs when the float is really small.
This works:
ruby-1.8 -e 'puts "1e-20".to_f'
This hangs:
ruby-1.8 -e 'puts "1e-100".to_f'
=end
=begin
I'm using archlinux. I've just tried several versions of the 1.8, the 174 and the 72 patches and both still hang. 1.9 works fine.
=end
- Status changed from Open to Feedback
=begin
Can you see if it still happens? I can't reproduce the situation on my machine now.
=end
=begin
Can't reproduce the bug on Mac OS X 10.6.5 with ruby-1.8.7-p302
=end
=begin
Can't reproduce on OSX10.6.5 and Debian squeeze (amd64) with 1.8 trunk.
[sorah@lemonade]:~/git/ruby/core18/builds/master% ruby -ve 'puts "1e-100".to_f'
ruby 1.8.8dev (2010-11-24) [i386-darwin10.5.0]
1.0e-100
[sorah@cleveland]:~/git/ruby/core18/builds/master% ruby -ve 'puts "1e-100".to_f'
ruby 1.8.8dev (2010-11-24) [x86_64-linux]
1.0e-100
=end
- Description updated (diff)
- Status changed from Feedback to Closed
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0