     self
   end
 
+  % Iterates the given function n times, passing values from zero
+  % to n - 1. Also has an accumulator similar to fold to store a
+  % value between computations.
+  %
+  % ## Examples
+  %
+  %    5.times(0, -> (acc, x) acc + x) % => 10
+  %
   def times(acc, function)
     times_2(self, 0, function, acc)
   end

    to_s
  end

  def times(function)
    if function.arity == 0
      times_0(self, 0, function)

    ]
  end

  % Convert an integer to the equivalent bit string.
  %
  % ## Examples
  %
  %    65.chr % => "A"
  %    97.chr % => "a"
  %
  def chr
    <<self>>
  end

  % Conver an integer to a char list of its digits.
  %
  % ## Examples
  %
  %    123.to_char_list % => [49, 50, 51]
  %
  def to_char_list
    Erlang.integer_to_list(self)
  end
