Bug #2792
closedString#to_f on Ruby-1.8.6-p399
Description
=begin
Ruby-1.8.6のString#to_fで、小数点の扱いがおかしいようです。
% ruby -v -e 'p "0.7".to_f'
ruby 1.8.6 (2010-02-05 patchlevel 399) [x86_64-linux]
7.0
% ruby -v -e 'p "0.7".to_f'
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
0.7
=end
Updated by runpaint (Run Paint Run Run) about 14 years ago
=begin
I suspect I'm seeing a symptom of the same problem. Just installed "ruby 1.8.6 (2010-03-05 patchlevel 400) [i686-linux]" from source, and found floats to be horribly broken.
1.3.to_int
=> 13
irb(main):002:0> 1.3.ceil
=> 13
irb(main):003:0> 2 + 0.5
=> 7.0
Am I missing a dependency or is this a regression?
=end
Updated by mame (Yusuke Endoh) about 14 years ago
=begin
遠藤です。
Ruby-1.8.6のString#to_fで、小数点の扱いがおかしいようです。
% ruby -v -e 'p "0.7".to_f'
ruby 1.8.6 (2010-02-05 patchlevel 399) [x86_64-linux]
7.0
gcc 4.4.1 を使っていませんか?
[ruby-core:26937] [ruby-core:28037] で同様の報告があり、
gcc 4.4.1 のバグのせいではないかということです。
gcc 4.3 か gcc 4.4.2 なら大丈夫だそうです。
--
Yusuke ENDOH mame@tsg.ne.jp
=end
Updated by runpaint (Run Paint Run Run) about 14 years ago
=begin
Bah. I'd missed that thread. Thanks, Yusuke.
=end
Updated by marcandre (Marc-Andre Lafortune) about 14 years ago
- Status changed from Open to Third Party's Issue
=begin
=end