On 9/14/07, lorenzo bolla <[EMAIL PROTECTED]> wrote:
>
> this is really annoying.
> Matlab handles the "ceil" weirdness quite well, though.
>
> --------------------------------------------------------------
>
> >> ceil(0.6/0.1)
>
> ans =
>
>      6
>
> >> ceil((0.4+0.2)/0.1)
>
> ans =
>
>      7
>
> >> 0:0.1:0.6
>
> ans =
>
>                          0    1.000000000000000e-001
> 2.000000000000000e-001    3.000000000000000e-001    4.000000000000000e-001
> 5.000000000000000e-001    6.000000000000000e-001
>
> >> 0:0.1:(0.4+0.2)
>
> ans =
>
>                          0    1.000000000000000e-001
> 2.000000000000000e-001    3.000000000000000e-001    4.000000000000001e-001
> 5.000000000000001e-001    6.000000000000001e-001
>

Well, in Matlab the end point is specified and the result of the division is
probably rounded, so in order to have problems you might need to use
something like .55 as the endpoint. In Numpy's arange an upper bound is used
instead, so roundoff is a problem, but the 5.5 case would be handled easily.

Chuck
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to