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

Method _isnan

Lib/_pydecimal.py:671–684  ·  view source on GitHub ↗

Returns whether the number is not actually one. 0 if a number 1 if NaN 2 if sNaN

(self)

Source from the content-addressed store, hash-verified

669 return cls(result)
670
671 def _isnan(self):
672 """Returns whether the number is not actually one.
673
674 0 if a number
675 1 if NaN
676 2 if sNaN
677 """
678 if self._is_special:
679 exp = self._exp
680 if exp == 'n':
681 return 1
682 elif exp == 'N':
683 return 2
684 return 0
685
686 def _isinfinity(self):
687 """Returns whether the number is infinite

Callers 11

_check_nansMethod · 0.95
__float__Method · 0.95
__int__Method · 0.95
_fixMethod · 0.95
_power_moduloMethod · 0.95
maxMethod · 0.95
minMethod · 0.95
compare_totalMethod · 0.95
max_magMethod · 0.95
min_magMethod · 0.95
create_decimalMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected