Actions
Bug #18517
closed0 << (2**40) is NoMemoryError but 0 << (2**80) is 0
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]
Description
I've been looking at Integer#{<<,>>} with RHS bignum and long and there are several issues.
This seems a clear bug though:
$ruby -e 'p 0 << (2**40)'
-e: failed to allocate memory (NoMemoryError)
$ ruby -e 'p 0 << (2**80)'
0
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0