[Numpy-discussion] arange(start, stop, step) and floating point (Ticket #8)

Robert Kern robert.kern at gmail.com
Wed Feb 8 14:04:16 EST 2006

Sasha (from the ticket comments):
"""I would prefer if arange, would do what range does and round step, possibly
with a warning for fractional steps. In other words, arange(start, stop, step,
dtype) should be an optimized version of array(range(start, stop, step), dtype).
If this is not acceptable, I think arange(start,stop,step)[-1] < stop should be
an invariant and floating point issues should be properly addressed.

arange() does allow for fractional steps unlinke range(). You may fix the
docstring if you like. However, I don't think it is possible to ensure that
invariant in the face of floating point. That's why we have linspace().

Robert Kern
robert.kern at gmail.com

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter

More information about the NumPy-Discussion mailing list