Project

General

Profile

Actions

Backport #5272

closed

Float#round doesn't round big values

Added by marcandre (Marc-Andre Lafortune) about 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
[ruby-core:39264]

Description

For large enough values (outside of Fixnum range), Float#round does not round at all but simply truncates:

2.999999999999999e20.round(-20) # => 200000000000000000000

Fixed in trunk, but would be nice to backport for Ruby 1.9.3.


Files

numeric.c.patch (328 Bytes) numeric.c.patch nagachika (Tomoyuki Chikanaga), 09/05/2011 05:11 PM

Related issues 1 (0 open1 closed)

Related to Backport193 - Backport #5276: 4294967295.8.round is 4294967295 on 32bitClosed09/05/2011Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0