MCPcopy Create free account
hub / github.com/python/cpython / is_qnan

Method is_qnan

Lib/_pydecimal.py:4556–4569  ·  view source on GitHub ↗

Return True if the operand is a quiet NaN; otherwise return False. >>> ExtendedContext.is_qnan(Decimal('2.50')) False >>> ExtendedContext.is_qnan(Decimal('NaN')) True >>> ExtendedContext.is_qnan(Decimal('sNaN')) False >>> ExtendedContext.is_qn

(self, a)

Source from the content-addressed store, hash-verified

4554 return a.is_normal(context=self)
4555
4556 def is_qnan(self, a):
4557 """Return True if the operand is a quiet NaN; otherwise return False.
4558
4559 >>> ExtendedContext.is_qnan(Decimal('2.50'))
4560 False
4561 >>> ExtendedContext.is_qnan(Decimal('NaN'))
4562 True
4563 >>> ExtendedContext.is_qnan(Decimal('sNaN'))
4564 False
4565 >>> ExtendedContext.is_qnan(1)
4566 False
4567 """
4568 a = _convert_other(a, raiseit=True)
4569 return a.is_qnan()
4570
4571 def is_signed(self, a):
4572 """Return True if the operand is negative; otherwise return False.

Callers 1

test_is_qnanMethod · 0.95

Calls 2

_convert_otherFunction · 0.85
is_qnanMethod · 0.45

Tested by 1

test_is_qnanMethod · 0.76