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

Method _islogical

Lib/_pydecimal.py:3315–3327  ·  view source on GitHub ↗

Return True if self is a logical operand. For being logical, it must be a finite number with a sign of 0, an exponent of 0, and a coefficient whose digits must all be either 0 or 1.

(self)

Source from the content-addressed store, hash-verified

3313 return ans._fix(context)
3314
3315 def _islogical(self):
3316 """Return True if self is a logical operand.
3317
3318 For being logical, it must be a finite number with a sign of 0,
3319 an exponent of 0, and a coefficient whose digits must all be
3320 either 0 or 1.
3321 """
3322 if self._sign != 0 or self._exp != 0:
3323 return False
3324 for dig in self._int:
3325 if dig not in '01':
3326 return False
3327 return True
3328
3329 def _fill_logical(self, context, opa, opb):
3330 dif = context.prec - len(opa)

Callers 3

logical_andMethod · 0.95
logical_orMethod · 0.95
logical_xorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected