On 14/09/2007, Charles R Harris <[EMAIL PROTECTED]> wrote: > Since none of the numbers are exactly represented in IEEE floating point, > this sort of oddity is expected. If you look at the exact values, (.4 + > .2)/.1 > 6 and .6/.1 < 6 . That said, I would expect something like > ceil(interval/delta - relatively_really_small_number) would generally return > the expected result. Matlab probably plays these sort of games. The downside > is encouraging bad programming habits. In this case, the programmer should > be using linspace..
There is actually a context in which floating-point arange makes sense: when you want evenly-spaced points and don't much care how many there are. No reason to play games in this context of course; the question is how to reduce user astonishment. Anne _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion