lib/baseconv.rb
def convert(digits, from_base:, to_base:)
    if from_base > MAX || to_base > MAX || from_base < MIN || to_base < MIN
      raise InvalidRadix,
        "cannot convert #{digits} from base #{from_base} to base #{to_base}"
    end

    if from_base < 37 && to_base < 37
      return digits.to_s.to_i(from_base).to_s(to_base)
    end

    represent(value_of(digits.to_s, in_base: from_base), in_base: to_base)
  end
# Convert
# 
# Convert the digits representation of a number from a given base to another.
Convert
Convert the digits representation of a number from a given base to another.
Convert Convert the digits representation of a number from a given base to another .
def convert(digits, from_base:, to_base:)
    if from_base > MAX || to_base > MAX || from_base < MIN || to_base < MIN
      raise InvalidRadix,
        "cannot convert #{digits} from base #{from_base} to base #{to_base}"
    end
    if from_base < 37 && to_base < 37
      return digits.to_s.to_i(from_base).to_s(to_base)
    end
    represent(value_of(digits.to_s, in_base: from_base), in_base: to_base)
  end
def convert ( digits , from_base : , to_base : ) if from_base > MAX || to_base > MAX || from_base < MIN || to_base < MIN raise InvalidRadix , "cannot convert #{digits} from base #{from_base} to base #{to_base}" end if from_base < 37 && to_base < 37 return digits . to_s . to_i ( from_base ) . to_s ( to_base ) end represent ( value_of ( digits . to_s , in_base : from_base ) , in_base : to_base ) end
Convert
Convert the digits representation of a number from a given base to another.
Convert Convert the digits representation of a number from a given base to another .
digits
from_base
to_base