Message272668
> What else can I do? Since I'm only dealing with integer powers, should I
> try using my own ipow(y, n) for testing?
I'd expect that a square-and-multiply-style pow would be less accurate than math.pow, in general, simply because of the number of floating-point operations involved.
But I don't think there's a real problem here so long as you don't have an expectation of getting super-accurate (e.g., correctly rounded or faithfully rounded) results; testing that results are accurate to within 10 ulps or so is probably good enough.
If you want an actual correctly-rounded nth root just for testing purposes, it's certainly possible to construct one with integer arithmetic, but an easier alternative might simply be to use MPFR's "mpfr_root" function (as wrapped by gmpy2) to generate test values. |
|
Date |
User |
Action |
Args |
2016-08-14 12:05:37 | mark.dickinson | set | recipients:
+ mark.dickinson, tim.peters, rhettinger, steven.daprano, martin.panter |
2016-08-14 12:05:37 | mark.dickinson | set | messageid: <1471176337.54.0.863617639651.issue27761@psf.upfronthosting.co.za> |
2016-08-14 12:05:37 | mark.dickinson | link | issue27761 messages |
2016-08-14 12:05:37 | mark.dickinson | create | |
|