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

Method is_nan

Lib/_pydecimal.py:4517–4531  ·  view source on GitHub ↗

Return True if the operand is a qNaN or sNaN; otherwise return False. >>> ExtendedContext.is_nan(Decimal('2.50')) False >>> ExtendedContext.is_nan(Decimal('NaN')) True >>> ExtendedContext.is_nan(Decimal('-sNaN')) True >>> ExtendedConte

(self, a)

Source from the content-addressed store, hash-verified

4515 return a.is_infinite()
4516
4517 def is_nan(self, a):
4518 """Return True if the operand is a qNaN or sNaN;
4519 otherwise return False.
4520
4521 >>> ExtendedContext.is_nan(Decimal('2.50'))
4522 False
4523 >>> ExtendedContext.is_nan(Decimal('NaN'))
4524 True
4525 >>> ExtendedContext.is_nan(Decimal('-sNaN'))
4526 True
4527 >>> ExtendedContext.is_nan(1)
4528 False
4529 """
4530 a = _convert_other(a, raiseit=True)
4531 return a.is_nan()
4532
4533 def is_normal(self, a):
4534 """Return True if the operand is a normal number;

Callers 1

test_is_nanMethod · 0.95

Calls 2

_convert_otherFunction · 0.85
is_nanMethod · 0.45

Tested by 1

test_is_nanMethod · 0.76