Project

General

Profile

Actions

Bug #12815

closed

Integer#digits's error message different when base is Fixnum or Bignum

Added by znz (Kazuhiro NISHIYAMA) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.4.0dev (2016-10-06 trunk 56364) [x86_64-linux]
[ruby-core:77502]

Description

Is this intended?

% ruby -ve '60.upto(65){|n| 1.digits(-(1<<n)) rescue p $! }'
ruby 2.4.0dev (2016-10-06 trunk 56364) [x86_64-linux]
#<ArgumentError: invalid radix -1152921504606846976>
#<ArgumentError: invalid radix -2305843009213693952>
#<ArgumentError: invalid radix -4611686018427387904>
#<ArgumentError: negative radix>
#<ArgumentError: negative radix>
#<ArgumentError: negative radix>
Actions

Also available in: Atom PDF

Like0
Like0