MCPcopy Index your code
hub / github.com/python/cpython / _isinfinity

Method _isinfinity

Lib/_pydecimal.py:686–697  ·  view source on GitHub ↗

Returns whether the number is infinite 0 if finite or not a number 1 if +INF -1 if -INF

(self)

Source from the content-addressed store, hash-verified

684 return 0
685
686 def _isinfinity(self):
687 """Returns whether the number is infinite
688
689 0 if finite or not a number
690 1 if +INF
691 -1 if -INF
692 """
693 if self._exp == 'F':
694 if self._sign:
695 return -1
696 return 1
697 return 0
698
699 def _check_nans(self, other=None, context=None):
700 """Returns whether the number is not actually one.

Callers 15

_cmpMethod · 0.95
__add__Method · 0.95
__mul__Method · 0.95
__truediv__Method · 0.95
__divmod__Method · 0.95
__mod__Method · 0.95
remainder_nearMethod · 0.95
__floordiv__Method · 0.95
__int__Method · 0.95
__pow__Method · 0.95
quantizeMethod · 0.95
sqrtMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected