Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

#26040: Improve coverage and rigour of test.test_math

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years ago by ja.py
Modified:
3 years, 7 months ago
Reviewers:
dickinsm
CC:
lemburg, mark.dickinson, eric.smith, christian.heimes, ned.deily, stutzbach, devnull_psf.upfronthosting.co.za, storchaka, jeff.allen, koobs
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Total comments: 3

Patch Set 3 #

Patch Set 4 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/test/cmath_testcases.txt View 1 2 3 10 chunks +141 lines, -0 lines 0 comments Download
Lib/test/test_math.py View 1 2 3 10 chunks +175 lines, -84 lines 0 comments Download

Messages

Total messages: 1
mark.dickinson
3 years, 7 months ago #1
https://bugs.python.org/review/26040/diff/18245/Lib/test/test_math.py
File Lib/test/test_math.py (right):

https://bugs.python.org/review/26040/diff/18245/Lib/test/test_math.py#newcode44
Lib/test/test_math.py:44: if digit=='1':
I'm not too comfortable with the assumptions this places on the output format of
`float.hex()`. I'll likely replace this with a struct-based function of the
function.

https://bugs.python.org/review/26040/diff/18245/Lib/test/test_math.py#newcode55
Lib/test/test_math.py:55: return 2.0**(exp-52)
Given the bad behaviour of the `pow` function in many math libraries, `ldexp` is
usually a safer way to compute powers of 2 and be sure of getting exact results.

https://bugs.python.org/review/26040/diff/18245/Lib/test/test_math.py#newcode...
Lib/test/test_math.py:1208: ulp_tol = 10
It's probably worth weakening this a bit; when I wrote the gamma function code,
10 ulps was an upper bound for the error I saw on one particular system with a
reasonable math library. The implementation uses the libm pow, which isn't
consistently implemented to a high standard across platforms.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+