Skip to content
  • Jeremy Evans's avatar
    d16b68cb
    Use Rational for Float#round with ndigits > 14 · d16b68cb
    Jeremy Evans authored
    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>
    d16b68cb
    Use Rational for Float#round with ndigits > 14
    Jeremy Evans authored
    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>
Loading