From: "nobu (Nobuyoshi Nakada)" Date: 2022-01-26T16:03:09+00:00 Subject: [ruby-core:107293] [Ruby master Bug#18517] 0 << (2**40) is NoMemoryError but 0 << (2**80) is 0 Issue #18517 has been updated by nobu (Nobuyoshi Nakada). https://github.com/ruby/ruby/pull/5494 ---------------------------------------- Bug #18517: 0 << (2**40) is NoMemoryError but 0 << (2**80) is 0 https://bugs.ruby-lang.org/issues/18517#change-96157 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal * ruby -v: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux] * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- 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 ``` -- https://bugs.ruby-lang.org/ Unsubscribe: