
Jan. 23, 2015
9:43 p.m.
On Fri, 23 Jan 2015 08:51:00 -0800 Chris Barker <chris.barker@noaa.gov> wrote:
As for the ulps test -- can you suggest a way to do that, while also providing a simple definition of tolerance that casual users can understand and use (and have a reasonable default? I know I can't. Note that some of the feedback on the PEP as is is that it's too hard to understand already! (without better docs, anyway)
My approach was roughly: delta = 2 ** (ulps - 53 - 1) * (abs(first) + abs(second)) assertAlmostEqual(first, second, delta=delta) I don't know if it's right in the case of denormals etc. (there's also special code surrounding that to care for zeros, infinities, and NaNs) Regards Antoine.