Project

General

Profile

This project is closed and read-only.

Actions

Backport #5272

closed

Float#round doesn't round big values

Backport #5272: Float#round doesn't round big values

Added by marcandre (Marc-Andre Lafortune) about 15 years ago. Updated almost 15 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 32bitClosedActions
Actions

Also available in: PDF Atom