Returns whether the number is not actually one. if self, other are sNaN, signal if self, other are NaN return nan return 0 Done before operations.
(self, other=None, context=None)
| 697 | return 0 |
| 698 | |
| 699 | def _check_nans(self, other=None, context=None): |
| 700 | """Returns whether the number is not actually one. |
| 701 | |
| 702 | if self, other are sNaN, signal |
| 703 | if self, other are NaN return nan |
| 704 | return 0 |
| 705 | |
| 706 | Done before operations. |
| 707 | """ |
| 708 | |
| 709 | self_is_nan = self._isnan() |
| 710 | if other is None: |
| 711 | other_is_nan = False |
| 712 | else: |
| 713 | other_is_nan = other._isnan() |
| 714 | |
| 715 | if self_is_nan or other_is_nan: |
| 716 | if context is None: |
| 717 | context = getcontext() |
| 718 | |
| 719 | if self_is_nan == 2: |
| 720 | return context._raise_error(InvalidOperation, 'sNaN', |
| 721 | self) |
| 722 | if other_is_nan == 2: |
| 723 | return context._raise_error(InvalidOperation, 'sNaN', |
| 724 | other) |
| 725 | if self_is_nan: |
| 726 | return self._fix_nan(context) |
| 727 | |
| 728 | return other._fix_nan(context) |
| 729 | return 0 |
| 730 | |
| 731 | def _compare_check_nans(self, other, context): |
| 732 | """Version of _check_nans used for the signaling comparisons |
no test coverage detected