Project

General

Profile

Bug #2483

String#to_f of small numbers hangs

Added by mikisvaz (Miguel Vazquez) almost 10 years ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
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

History

#1

Updated by mikisvaz (Miguel Vazquez) almost 10 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

#2

Updated by shyouhei (Shyouhei Urabe) almost 9 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

#3

Updated by zimbatm (zimba tm) almost 9 years ago

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

#4

Updated by sorah (Sorah Fukumori) almost 9 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

#5

Updated by jeremyevans0 (Jeremy Evans) about 2 months ago

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

Also available in: Atom PDF