<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jan 9, 2015 at 2:17 PM, Andrew Barnert <span dir="ltr"><<a href="mailto:abarnert@yahoo.com.dmarc.invalid" target="_blank">abarnert@yahoo.com.dmarc.invalid</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is equivalent on designing float.__eq__ as something like abs(self-other) < 0.00000001. At first glance it seems like that makes all floating point comparison problems go away, until you try it with small floats and suddenly 9e-12 - 1e-12 == 4e-12.<br>
<br>
The right epsilon to use depends on the specific problem space, so it can't be hardcoded into a general-purpose function.</blockquote><div><br></div><div>You could scale the epsilon with step, and get closer to general purpose. but then you STILL might not get exactly what was expected.</div><div><br></div><div>Making an fp range an attractive nuisance.</div><div><br></div><div>And I still think most people actually want linspace(), anyway...</div><div><br></div><div>Note that a closed interval version with a specified delta could be handy, but not hard to just compute the number of elements if you want.</div><div><br></div><div>-Chris</div><div> </div></div><div><br></div>-- <br><div class="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            (206) 526-6959   voice<br>7600 Sand Point Way NE   (206) 526-6329   fax<br>Seattle, WA  98115       (206) 526-6317   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div>