[Numpy-discussion] arange and floating point arguments

Joris De Ridder Joris.DeRidder at ster.kuleuven.be
Sat Sep 15 06:52:40 EDT 2007


On 14 Sep 2007, at 23:51, Robert Kern wrote:

> You can hide some of the surprises, but not all of them.

I guess it's impossible to make a bullet-proof "fix". When arange()  
gets a 'stop' value of 0.60000000000000009, it cannot possibly know  
whether this stop value is supposed to be 0.6, or whether this value  
is the result of a genuine computation that has nothing to do with  
inexact number representation. In the latter case, I would definitely  
want arange() to be working as it does now.

It seems, though, if linspace() is the better equivalent of arange(),  
its default endpoint=True option seems a little bit inconvenient (but  
by no means a problem), as you would always have to reset it to  
emulate arange() behaviour.

Joris


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm




More information about the NumPy-Discussion mailing list