
On 01/23/2015 07:36 AM, Antoine Pitrou wrote:
On Thu, 22 Jan 2015 16:40:14 -0800 Chris Barker wrote:
Expected Uses =============
The primary expected use case is various forms of testing -- "are the results computed near what I expect as a result?" This sort of test may or may not be part of a formal unit testing suite.
I don't think the proposal fits the bill. For testing you want a function that is both 1) quite rigorous (i.e. checks equality within a defined number of ulps) 2) handles all special cases in a useful way (i.e. zeros, including distinguishing between positive and negative zeros, infinities, NaNs etc.).
I disagree -- this function is not meant for mathematicians, but for the non-maths person who needs something that works. Will there be situations where it doesn't work? Certainly. Will they be surprising? Possibly. On the other hand, I was very surprised the first time an bytes object gave me an integer and not a byte.
As someone who wrote such a function for Numba, what you're proposing would not be a suitable replacement.
This isn't for Numba, SciPy, or NumPy. It's to help those who don't use/need those products, but still have some light floating point work to do. -- ~Ethan~