Check if results of _decimal's power function are within the allowed ulp ranges.
(self, t)
| 473 | return False |
| 474 | |
| 475 | def bin_resolve_ulp(self, t): |
| 476 | """Check if results of _decimal's power function are within the |
| 477 | allowed ulp ranges.""" |
| 478 | # NaNs are beyond repair. |
| 479 | if t.rc.is_nan() or t.rp.is_nan(): |
| 480 | return False |
| 481 | |
| 482 | # "exact" result, double precision, half_even |
| 483 | self.maxctx.prec = context.p.prec * 2 |
| 484 | |
| 485 | op1, op2 = t.pop[0], t.pop[1] |
| 486 | if t.contextfunc: |
| 487 | exact = getattr(self.maxctx, t.funcname)(op1, op2) |
| 488 | else: |
| 489 | exact = getattr(op1, t.funcname)(op2, context=self.maxctx) |
| 490 | |
| 491 | # _decimal's rounded result |
| 492 | rounded = P.Decimal(t.cresults[0]) |
| 493 | |
| 494 | self.ulpdiff += 1 |
| 495 | return self.check_ulpdiff(exact, rounded) |
| 496 | |
| 497 | ############################ Correct rounding ############################# |
| 498 | def resolve_underflow(self, t): |
no test coverage detected