    # File lib/facets/more/interval.rb, line 217
      def each(n=1, d=nil)  # :yield:
        return (n < 0 ? @last : @first) if degenerate?  # is this right for all values of n ?
        s = d ? self.length.to_f * (n.to_f / d.to_f) : n.abs
        raise "Cannot iterate over zero length steps." if s == 0
        s = s * @direction
        if n < 0
          e = @exclude_last ? @last - s : @last
          #e = @exclude_last ? @last.pred(s) : @last
          t = @exlude_last ? 1 : 0
          #while e.cmp(@first) >= t
          while (e <=> @first) >= t
            yield(e)
            e -= s
            #e = e.pred(s)
          end
        else
          e = @exclude_first ? @first + s : @first
          #e = @exclude_first ? @first.succ(s) : @first
          t = @exlude_last ? -1 : 0
          #while e.cmp(@last) <= t
          while (e <=> @last) <= t
            yield(e)
            e += s
            #e = e.succ(s)
          end
        end
      end