Mark Dickinson added the comment:

I've reviewed the test_math portion of the patch (which looks good, thank 
you!), and made a few revisions in iss26040_v3.patch.

1. I've rewritten the ulp() function to use struct. Same behaviour as before, 
but this way feels safer, since it doesn't rely on the exact form of the 
float.hex format.

2. I've reworked the ulp-based comparison to use the old to_ulps function, 
instead of basing it on ulp(). That's mostly just a personal preference: I 
prefer the symmetry of the abs(to_ulps(got) - to_ulps(expected)) form, and I 
think it behaves slightly better at or near powers of two. (If expected == 1.0 
and got == 1.0 - 2**-51, I want that to be seen as 4 ulps error rather than 2.)

3. I increased the default ulp tolerance to 5 ulps, and increased the ulps 
tolerance for some of the special cases. There are some badly behaved libm 
implementations out there, and I don't want to break more buildbots than 
necessary.

----------
Added file: https://bugs.python.org/file44253/iss26040_v3.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue26040>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to