[ruby-core:123769] [Ruby Bug#21680] Integer#digits bug starting from Ruby 3.1
Issue #21680 has been reported by sigsys (Math Ieu). ---------------------------------------- Bug #21680: Integer#digits bug starting from Ruby 3.1 https://bugs.ruby-lang.org/issues/21680 * Author: sigsys (Math Ieu) * Status: Open * ruby -v: ruby 3.3.10 (2025-10-23 revision 343ea05002) [amd64-freebsd14] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- ``` (2**512).digits(256).last ``` The result was 1 on Ruby 3.0. Starting from Ruby 3.1 it turned to 256 (which can't possibly be right). -- https://bugs.ruby-lang.org/
Issue #21680 has been updated by tompng (tomoya ishida). Pull request https://github.com/ruby/ruby/pull/15144 ---------------------------------------- Bug #21680: Integer#digits bug starting from Ruby 3.1 https://bugs.ruby-lang.org/issues/21680#change-115162 * Author: sigsys (Math Ieu) * Status: Open * ruby -v: ruby 3.3.10 (2025-10-23 revision 343ea05002) [amd64-freebsd14] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- ``` (2**512).digits(256).last ``` The result was 1 on Ruby 3.0. Starting from Ruby 3.1 it turned to 256 (which can't possibly be right). -- https://bugs.ruby-lang.org/
Issue #21680 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED to 3.2: REQUIRED, 3.3: DONE, 3.4: REQUIRED ruby_3_3 commit:bc21e4d40daeb962699340162547e0fb2b50107f merged revision(s) commit:f4f728b319086eea3db6e9909fb9c849c276f813. ---------------------------------------- Bug #21680: Integer#digits bug starting from Ruby 3.1 https://bugs.ruby-lang.org/issues/21680#change-115358 * Author: sigsys (Math Ieu) * Status: Closed * ruby -v: ruby 3.3.10 (2025-10-23 revision 343ea05002) [amd64-freebsd14] * Backport: 3.2: REQUIRED, 3.3: DONE, 3.4: REQUIRED ---------------------------------------- ``` (2**512).digits(256).last ``` The result was 1 on Ruby 3.0. Starting from Ruby 3.1 it turned to 256 (which can't possibly be right). -- https://bugs.ruby-lang.org/
Issue #21680 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.2: REQUIRED, 3.3: DONE, 3.4: REQUIRED to 3.2: REQUIRED, 3.3: DONE, 3.4: DONE ruby_3_4 commit:fe8221af30768cbd15409d4cc52b2bb18e91667e merged revision(s) commit:f4f728b319086eea3db6e9909fb9c849c276f813. ---------------------------------------- Bug #21680: Integer#digits bug starting from Ruby 3.1 https://bugs.ruby-lang.org/issues/21680#change-115501 * Author: sigsys (Math Ieu) * Status: Closed * ruby -v: ruby 3.3.10 (2025-10-23 revision 343ea05002) [amd64-freebsd14] * Backport: 3.2: REQUIRED, 3.3: DONE, 3.4: DONE ---------------------------------------- ``` (2**512).digits(256).last ``` The result was 1 on Ruby 3.0. Starting from Ruby 3.1 it turned to 256 (which can't possibly be right). -- https://bugs.ruby-lang.org/
participants (4)
-
k0kubun (Takashi Kokubun) -
nagachika (Tomoyuki Chikanaga) -
sigsys (Math Ieu) -
tompng (tomoya ishida)