Returns the largest representable number smaller than itself.
(self, context=None)
| 3506 | return ans._fix(context) |
| 3507 | |
| 3508 | def next_minus(self, context=None): |
| 3509 | """Returns the largest representable number smaller than itself.""" |
| 3510 | if context is None: |
| 3511 | context = getcontext() |
| 3512 | |
| 3513 | ans = self._check_nans(context=context) |
| 3514 | if ans: |
| 3515 | return ans |
| 3516 | |
| 3517 | if self._isinfinity() == -1: |
| 3518 | return _NegativeInfinity |
| 3519 | if self._isinfinity() == 1: |
| 3520 | return _dec_from_triple(0, '9'*context.prec, context.Etop()) |
| 3521 | |
| 3522 | context = context.copy() |
| 3523 | context._set_rounding(ROUND_FLOOR) |
| 3524 | context._ignore_all_flags() |
| 3525 | new_self = self._fix(context) |
| 3526 | if new_self != self: |
| 3527 | return new_self |
| 3528 | return self.__sub__(_dec_from_triple(0, '1', context.Etiny()-1), |
| 3529 | context) |
| 3530 | |
| 3531 | def next_plus(self, context=None): |
| 3532 | """Returns the smallest representable number larger than itself.""" |
no test coverage detected