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

Method is_zero

Lib/_pydecimal.py:4626–4641  ·  view source on GitHub ↗

Return True if the operand is a zero; otherwise return False. >>> ExtendedContext.is_zero(Decimal('0')) True >>> ExtendedContext.is_zero(Decimal('2.50')) False >>> ExtendedContext.is_zero(Decimal('-0E+2')) True >>> ExtendedContext.is_zero(1)

(self, a)

Source from the content-addressed store, hash-verified

4624 return a.is_subnormal(context=self)
4625
4626 def is_zero(self, a):
4627 """Return True if the operand is a zero; otherwise return False.
4628
4629 >>> ExtendedContext.is_zero(Decimal('0'))
4630 True
4631 >>> ExtendedContext.is_zero(Decimal('2.50'))
4632 False
4633 >>> ExtendedContext.is_zero(Decimal('-0E+2'))
4634 True
4635 >>> ExtendedContext.is_zero(1)
4636 False
4637 >>> ExtendedContext.is_zero(0)
4638 True
4639 """
4640 a = _convert_other(a, raiseit=True)
4641 return a.is_zero()
4642
4643 def ln(self, a):
4644 """Returns the natural (base e) logarithm of the operand.

Callers 1

test_is_zeroMethod · 0.95

Calls 2

_convert_otherFunction · 0.85
is_zeroMethod · 0.45

Tested by 1

test_is_zeroMethod · 0.76