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

Method is_normal

Lib/_pydecimal.py:4530–4551  ·  view source on GitHub ↗

Return True if the operand is a normal number; otherwise return False. >>> c = ExtendedContext.copy() >>> c.Emin = -999 >>> c.Emax = 999 >>> c.is_normal(Decimal('2.50')) True >>> c.is_normal(Decimal('0.1E-999')) False >>> c.is_

(self, a)

Source from the content-addressed store, hash-verified

4528 return a.is_nan()
4529
4530 def is_normal(self, a):
4531 """Return True if the operand is a normal number;
4532 otherwise return False.
4533
4534 >>> c = ExtendedContext.copy()
4535 >>> c.Emin = -999
4536 >>> c.Emax = 999
4537 >>> c.is_normal(Decimal('2.50'))
4538 True
4539 >>> c.is_normal(Decimal('0.1E-999'))
4540 False
4541 >>> c.is_normal(Decimal('0.00'))
4542 False
4543 >>> c.is_normal(Decimal('-Inf'))
4544 False
4545 >>> c.is_normal(Decimal('NaN'))
4546 False
4547 >>> c.is_normal(1)
4548 True
4549 """
4550 a = _convert_other(a, raiseit=True)
4551 return a.is_normal(context=self)
4552
4553 def is_qnan(self, a):
4554 """Return True if the operand is a quiet NaN; otherwise return False.

Callers 1

test_is_normalMethod · 0.95

Calls 2

_convert_otherFunction · 0.85
is_normalMethod · 0.45

Tested by 1

test_is_normalMethod · 0.76