Bug #2838

Ruby 1.8.7 (2009-06-12 patchlevel 174) strange round behaviour

Added by kotecci (P K) about 2 years ago. Updated about 1 year ago.

[ruby-core:28505]
Status:Rejected Start date:03/05/2010
Priority:Low Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
ruby -v:1.8.7 (2009-06-12 patchlevel 174)

Description

?> a = 64.01+128.38+123.96
=> 316.35
>>
?> b = 300+16.35
=> 316.35

?> (a * 10).round
=> 3163
>> (b * 10).round
=> 3164

History

Updated by nobu (Nobuyoshi Nakada) about 2 years ago

  • Status changed from Open to Rejected
  • Priority changed from Immediate to Low
FAQ.

Updated by naruse (Yui NARUSE) about 2 years ago

Read this:
http://docs.sun.com/source/806-3568/ncg_goldberg.html

Updated by murphy (Kornelius Kalnbach) about 2 years ago

On 06.03.10 00:23, Yui NARUSE wrote:
> http://docs.sun.com/source/806-3568/ncg_goldberg.html
In short: Don't expect exact results when using Floats ;)

Also available in: Atom PDF