On 5/2/2010 1:51 PM, Gökhan Sever wrote:
> The following is another surprise output:
>
> I[5]: c = np.arange(0.4, 0.5, 0.1, dtype='float32')
> [6]: c
> O[6]: array([ 0.40000001], dtype=float32)



>>> a = np.array([0.4,0.5,0.1], dtype='float32')
>>> a[0]
0.40000001
>>> (a[1]-a[0])/a[2]
0.99999994
>>> np.ceil((a[1]-a[0])/a[2])
1.0

The docstring states:

       For floating point arguments, the length of the result is
       ``ceil((stop - start)/step)``.

hth,
Alan Isaac


_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to