Project

General

Profile

Actions

Bug #7245

closed

Float.round result not as expected

Added by alexr (Alexander Rusa) over 11 years ago. Updated over 11 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3p286 (2012-10-12 revision 37164) [x86_64-darwin12.2.0]
Backport:
[ruby-core:48593]

Description

In my second example below I would expect "1.01" as result.

1.9.3-p286 :001 > 1.05.round(1)
=> 1.1
1.9.3-p286 :002 > 1.005.round(2)
=> 1.0
1.9.3-p286 :003 > 1.006.round(2)
=> 1.01

Is this a bug or am I wrong?

Actions

Also available in: Atom PDF

Like0
Like0