Actions
Bug #20654
closedFloor and ceil have unexpected behaviour when ndigits is large
Bug #20654:
Floor and ceil have unexpected behaviour when ndigits is large
Description
GitHub PR: https://github.com/ruby/ruby/pull/11257
There is unexpected behaviour in Integer#floor, Float#floor, Integer#ceil, Float#ceil when ndigits is large such that 10**ndigits is a bignum.
Previously, it would return 0 in such cases. However, this would cause unexpected behaviour such as:
The PR changes the last result so that it will return -100000000000000000000 and 100000000000000000000, respectively.
Actions