From: "naruse (Yui NARUSE)" Date: 2022-02-01T12:42:02+00:00 Subject: [ruby-core:107411] [Ruby master Bug#18517] 0 << (2**40) is NoMemoryError but 0 << (2**80) is 0 Issue #18517 has been updated by naruse (Yui NARUSE). Backport changed from 2.6: UNKNOWN, 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED to 2.6: UNKNOWN, 2.7: REQUIRED, 3.0: REQUIRED, 3.1: DONE ruby_3_1 1f17463dec2ab1535096cb56005a840eae4fea5b merged revision(s) 6a6227e0168b059c3ed34c9f0ace2e5dc2364221. ---------------------------------------- Bug #18517: 0 << (2**40) is NoMemoryError but 0 << (2**80) is 0 https://bugs.ruby-lang.org/issues/18517#change-96310 * Author: Eregon (Benoit Daloze) * Status: Closed * Priority: Normal * ruby -v: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux] * Backport: 2.6: UNKNOWN, 2.7: REQUIRED, 3.0: REQUIRED, 3.1: DONE ---------------------------------------- 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: