Project

General

Profile

Actions

Bug #2483

closed

String#to_f of small numbers hangs

Added by mikisvaz (Miguel Vazquez) over 14 years ago. Updated over 4 years ago.

Status:
Closed
Assignee:
-
ruby -v:
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]
[ruby-core:27175]

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

Actions #1

Updated by mikisvaz (Miguel Vazquez) over 14 years ago

=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

Actions #2

Updated by shyouhei (Shyouhei Urabe) over 13 years ago

  • 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

Actions #3

Updated by zimbatm (zimba tm) over 13 years ago

=begin
Can't reproduce the bug on Mac OS X 10.6.5 with ruby-1.8.7-p302
=end

Actions #4

Updated by sorah (Sorah Fukumori) over 13 years ago

=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

Actions #5

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

  • Description updated (diff)
  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0