Project

General

Profile

Actions

Bug #2792

closed

String#to_f on Ruby-1.8.6-p399

Added by mutomasa (Masao Mutoh) about 14 years ago. Updated almost 13 years ago.

Status:
Third Party's Issue
Assignee:
-
ruby -v:
ruby 1.8.6 (2010-02-05 patchlevel 399) [x86_64-linux]
[ruby-dev:40487]

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

Actions #1

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

Actions #2

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

=end

Actions #3

Updated by runpaint (Run Paint Run Run) about 14 years ago

=begin
Bah. I'd missed that thread. Thanks, Yusuke.
=end

Actions #4

Updated by marcandre (Marc-Andre Lafortune) about 14 years ago

  • Status changed from Open to Third Party's Issue

=begin

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0