struct Int32
- Int32
- Int
- Number
- Value
- Object
Defined in:
int32.crClass Method Summary
Instance Method Summary
-
#digits
Returns the digits of a number in a given base.
Class Method Detail
Instance Method Detail
def digits
#
Description copied from struct Int
Returns the digits of a number in a given base. The digits are returned as an array with the least significant digit as the first array element.
12345.digits # => [5, 4, 3, 2, 1]
12345.digits(7) # => [4, 6, 6, 0, 5]
12345.digits(100) # => [45, 23, 1]
-12345.digits(7) # => ArgumentError