<div dir="ltr">It would be useful when we need to subtracting a bit before comparing by greater or less. By subtracting a bit, we only have an absolute error tolerance and with the new functions, we can have both absolute and relative error tolerance. This is how isclose(a, b) better than abs(a-b)<=atol.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-10-19 15:46 GMT-04:00 Chris Barker <span dir="ltr"><<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 19, 2015 at 3:06 AM, cy18 <span dir="ltr"><<a href="mailto:thecy18@gmail.com" target="_blank">thecy18@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I think these would be useful and easy to implement.</div><div><br></div><div> greater_close(a, b) = greater_equal(a, b) | isclose(a, b)</div><div> less_close(a, b) = less_equal(a, b) | isclose(a, b)</div><div> greater_no_close = greater(a, b) & ~isclose(a, b)</div><div> less_no_close = less(a, b) & ~isclose(a, b)</div></div></blockquote><div><br></div><div>What's the use-case here? we need is_close because we want to test equality, but precision errors are such that two floats may be as close to equal as they can be given the computations done. And the assumption is that you don't care about the precision to the point you specify.</div><div><br></div><div>But for a greater_than (or equiv) comparison, if you the precision is not important beyond a certain level, then it's generally not important whether you get greater than or less than when it's that close....</div><div><br></div><div>And this would great a wierd property that some values would be greater than, less than, and equal to a target value -- pretty weird!</div><div><br></div><div>note that you can get the same effect by subtracting a bit from your comparison value for a greater than check...</div><div><br></div><div>But maybe there is a common use-case that I'm not thinking of..</div><div><br></div><div>-CHB</div></div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R <a href="tel:%28206%29%20526-6959" value="+12065266959" target="_blank">(206) 526-6959</a> voice<br>7600 Sand Point Way NE <a href="tel:%28206%29%20526-6329" value="+12065266329" target="_blank">(206) 526-6329</a> fax<br>Seattle, WA 98115 <a href="tel:%28206%29%20526-6317" value="+12065266317" target="_blank">(206) 526-6317</a> main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</font></span></div></div>
<br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="https://mail.scipy.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br></div>