 
   """
   @spec to_string(integer, 2..36) :: String.t
-  def to_string(some_integer, base) do
+  def to_string(some_integer, base) when is_integer(base) and base in 2..36 do
     :erlang.integer_to_binary(some_integer, base)
   end
 


  """
  @spec to_char_list(integer, 2..36) :: char_list
  def to_char_list(number, base) do
    :erlang.integer_to_list(number, base)
  end
end

      [1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1]

  """
  @spec digits(non_neg_integer, pos_integer) :: [non_neg_integer]
  def digits(n, base \\ 10) when is_integer(n)    and n >= 0
                            and  is_integer(base) and base >= 2 do
    do_digits(n, base, [])
