MCPcopy Index your code
hub / github.com/RustPython/RustPython / is_infinite

Method is_infinite

Lib/_pydecimal.py:4499–4512  ·  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

4497 return a.is_finite()
4498
4499 def is_infinite(self, a):
4500 """Return True if the operand is infinite; otherwise return False.
4501
4502 >>> ExtendedContext.is_infinite(Decimal('2.50'))
4503 False
4504 >>> ExtendedContext.is_infinite(Decimal('-Inf'))
4505 True
4506 >>> ExtendedContext.is_infinite(Decimal('NaN'))
4507 False
4508 >>> ExtendedContext.is_infinite(1)
4509 False
4510 """
4511 a = _convert_other(a, raiseit=True)
4512 return a.is_infinite()
4513
4514 def is_nan(self, a):
4515 """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