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

Method is_infinite

Lib/_pydecimal.py:4502–4515  ·  view source on GitHub ↗

Return True if the operand is infinite; otherwise return False. >>> ExtendedContext.is_infinite(Decimal('2.50')) False >>> ExtendedContext.is_infinite(Decimal('-Inf')) True >>> ExtendedContext.is_infinite(Decimal('NaN')) False >>> ExtendedCont

(self, a)

Source from the content-addressed store, hash-verified

4500 return a.is_finite()
4501
4502 def is_infinite(self, a):
4503 """Return True if the operand is infinite; otherwise return False.
4504
4505 >>> ExtendedContext.is_infinite(Decimal('2.50'))
4506 False
4507 >>> ExtendedContext.is_infinite(Decimal('-Inf'))
4508 True
4509 >>> ExtendedContext.is_infinite(Decimal('NaN'))
4510 False
4511 >>> ExtendedContext.is_infinite(1)
4512 False
4513 """
4514 a = _convert_other(a, raiseit=True)
4515 return a.is_infinite()
4516
4517 def is_nan(self, a):
4518 """Return True if the operand is a qNaN or sNaN;

Callers 1

test_is_infiniteMethod · 0.95

Calls 2

_convert_otherFunction · 0.85
is_infiniteMethod · 0.45

Tested by 1

test_is_infiniteMethod · 0.76