   end
 
   @doc """
-  Converts a binary to an integer.
+  Converts a binary from a text representation of an integer
+  in an optional base `base` to the corresponding integer.
+
+  If the base `base` is not given, base 10 will be used.
 
   If successful, returns a tuple of the form `{integer, remainder_of_binary}`.
   Otherwise `:error`.
 
+  Raises an error if `base` is less than 2 or more than 36.
+
   ## Examples
 
       iex> Integer.parse("34")


  """
  @spec parse(binary, integer) :: {integer, binary} | :error | no_return
  def parse(binary, base) when is_integer(base) and base in 2..36 do
    parse_in_base(binary, base)
  end

      iex> Integer.parse("three")
      :error

      iex > Integer.parse("34", 10)
      {34, ""}

