Compares the values numerically with their sign ignored.
(self, other, context=None)
| 3443 | return ans._fix(context) |
| 3444 | |
| 3445 | def min_mag(self, other, context=None): |
| 3446 | """Compares the values numerically with their sign ignored.""" |
| 3447 | other = _convert_other(other, raiseit=True) |
| 3448 | |
| 3449 | if context is None: |
| 3450 | context = getcontext() |
| 3451 | |
| 3452 | if self._is_special or other._is_special: |
| 3453 | # If one operand is a quiet NaN and the other is number, then the |
| 3454 | # number is always returned |
| 3455 | sn = self._isnan() |
| 3456 | on = other._isnan() |
| 3457 | if sn or on: |
| 3458 | if on == 1 and sn == 0: |
| 3459 | return self._fix(context) |
| 3460 | if sn == 1 and on == 0: |
| 3461 | return other._fix(context) |
| 3462 | return self._check_nans(other, context) |
| 3463 | |
| 3464 | c = self.copy_abs()._cmp(other.copy_abs()) |
| 3465 | if c == 0: |
| 3466 | c = self.compare_total(other) |
| 3467 | |
| 3468 | if c == -1: |
| 3469 | ans = self |
| 3470 | else: |
| 3471 | ans = other |
| 3472 | |
| 3473 | return ans._fix(context) |
| 3474 | |
| 3475 | def next_minus(self, context=None): |
| 3476 | """Returns the largest representable number smaller than itself.""" |