On 9/14/07, Robert Kern <[EMAIL PROTECTED]> wrote:
>
> Charles R Harris wrote:
>
> > In the case of arange it should be possible to determine when the result
> > is potentially ambiguous and issue a warning. For instance, if the
> > argument of the ceil function is close to its rounded value.
>
> What's "close"? The appropriate tolerance depends on the operations that
> would
> cause error. For literal inputs, where the only source of error is
> representation error, 1 eps would suffice, but then so would linspace().
> For
> results of other computations, you might need more than 1 eps. But if
> you're
> doing computations, then it oughtn't to matter whether you get the
> endpoint or
> not (since you don't know what the values are anyway).


I would make 'close' very rough, maybe a relative 100*eps. The point would
be to warn of *potential* problems and suggest linspace or some other
approach, not to warn on only real problems. My guess is that most uses of
arange are either well defined or such that a less ambiguous approach should
be used. In a way, the warning would be a guess at programmer intent and a
gentler solution than making arange integer only.

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

Reply via email to