[Numpy-discussion] [Feature Suggestion]More comparison functions for floating point numbers

2015-10-19 Thread cy18
I think these would be useful and easy to implement. greater_close(a, b) = greater_equal(a, b) | isclose(a, b) less_close(a, b) = less_equal(a, b) | isclose(a, b) greater_no_close = greater(a, b) & ~isclose(a, b) less_no_close = less(a, b) & ~isclose(a, b) The results are

Re: [Numpy-discussion] [Feature Suggestion]More comparison functions for floating point numbers

2015-10-19 Thread Robert Kern
On Mon, Oct 19, 2015 at 9:51 PM, cy18 wrote: > > 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

Re: [Numpy-discussion] [Feature Suggestion]More comparison functions for floating point numbers

2015-10-19 Thread cy18
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.

Re: [Numpy-discussion] [Feature Suggestion]More comparison functions for floating point numbers

2015-10-19 Thread Chris Barker
On Mon, Oct 19, 2015 at 3:06 AM, cy18 wrote: > I think these would be useful and easy to implement. > > greater_close(a, b) = greater_equal(a, b) | isclose(a, b) > less_close(a, b) = less_equal(a, b) | isclose(a, b) > greater_no_close = greater(a, b) & ~isclose(a,