Project

General

Profile

This project is closed and read-only.

Actions

Bug #2838

closed

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

Bug #2838: Ruby 1.8.7 (2009-06-12 patchlevel 174) strange round behaviour

Added by kotecci (P K) over 16 years ago. Updated over 15 years ago.

Status:
Rejected
Assignee:
-
ruby -v:
1.8.7 (2009-06-12 patchlevel 174)
[ruby-core:28505]

Description

=begin
?> a = 64.01+128.38+123.96
=> 316.35

?> b = 300+16.35
=> 316.35

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

(b * 10).round
=> 3164
=end

Updated by nobu (Nobuyoshi Nakada) over 16 years ago Actions #1

  • Status changed from Open to Rejected
  • Priority changed from 7 to 3

=begin
FAQ.
=end

Updated by murphy (Kornelius Kalnbach) over 16 years ago Actions #3

=begin
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 ;)

=end

Actions

Also available in: PDF Atom