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

Travis Oliphant oliphant.travis at ieee.org
Thu Feb 9 12:30:03 EST 2006


Tim Hochberg wrote:

> That is, not only did all of the incorrect end cases go away, it 
> actually got marginally faster. Why it got faster I can't say, there's 
> not much to be gained in second guessing an optimizing compiler. It's 
> quite possible that this may be compiler dependant, so I'd be 
> interested in the results with other compilers. Also, I only sampled a 
> small chunk of the input space of arange, so if you have some other 
> failing input values, please send them to me and I can test them and 
> see if this change fixes them also.
>
> I didn't mess with the complex version of fill yet. Is that just there 
> to support arange(0, 100, 2, dtype=complex), or is there some other 
> use for _fill besides arange?


This is a simple change and one we could easily do.  The complex 
versions are there to support complex arange?  There are no other uses 
"currently" for fill.  Although you could use it with two equal values 
to fill an array with the same thing quickly.   I have yet to test a 
version of ones using fill against the current implementation which adds 
1 to a zeros array.

Thanks for the changes.

-Travis






More information about the NumPy-Discussion mailing list