summaryrefslogtreecommitdiff
path: root/test/ruby/test_basicinstructions.rb
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2024-07-26 11:10:53 -0400
committerPeter Zhu <peter@peterzhu.ca>2024-07-30 08:21:28 -0400
commita7167d0ceecc8eea7bdf87e66be16d16b0f417e7 (patch)
tree8f4b9c2eca4750baa5ef7fe37139e07621235647 /test/ruby/test_basicinstructions.rb
parent3af2a7fbe12e11bac7b26bd991d3d02349f47295 (diff)
Fix ceil when ndigits is large
[Bug #20654] This commit fixes Integer#ceil and Float#ceil when the number is negative and 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: puts 1.ceil(-5) # => 100000 puts 1.ceil(-10) # => 10000000000 puts 1.ceil(-20) # => 0 This commit changes the last result so that it will return 100000000000000000000.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11257
Diffstat (limited to 'test/ruby/test_basicinstructions.rb')
0 files changed, 0 insertions, 0 deletions