|
From: Travis O. <oli...@ee...> - 2006-02-08 22:58:41
|
Sasha wrote: >On 2/8/06, Robert Kern <rob...@gm...> wrote: > > >> ... >>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(). >> >> > >There is certainly a way to ensure that arange(..., stop, ...)[-1] < >stop in the face of floating point -- just repeat start += step with >start in a volatile double variable until it exceeds stop to get the >length of the result. There might be an O(1) solution as well, but >it may require some assumptions about the floating point unit. > >In any case, I can do one of the following depending on a vote: > >1 (default). Document length=ceil((stop - start)/step) in the arange docstring > > +5 We can't really do anything else at this point since this behavior has been what is with us for a long time. -Travis |