to_digits method for fixnum and bignum