Actions
Bug #17183
closedFloat round working weirdly
Bug #17183:
Float round working weirdly
Description
Actions
Added by agustincornu (Agustin Cornu) almost 6 years ago. Updated almost 5 years ago.
Description
This is a known issue and not a bug. My bad. I cannot delete the ticket
I think that's a bug. Looks different but maybe related to #14365.
Agreed to @marcandre (Marc-Andre Lafortune) . This sounds like a real bug.
Applied in changeset git|d16b68cb2204eeb5af8bd39149202b630374c67f.
Use Rational for Float#round with ndigits > 14
ndigits higher than 14 can result in values that are slightly too
large due to floating point limitations. Converting to rational
for the calculation and then back to float fixes these issues.
Fixes [Bug #14635]
Fixes [Bug #17183]
Co-authored by: Yusuke Endoh mame@ruby-lang.org