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)
| 3316 | return ans._fix(context) |
| 3317 | |
| 3318 | def _islogical(self): |
| 3319 | """Return True if self is a logical operand. |
| 3320 | |
| 3321 | For being logical, it must be a finite number with a sign of 0, |
| 3322 | an exponent of 0, and a coefficient whose digits must all be |
| 3323 | either 0 or 1. |
| 3324 | """ |
| 3325 | if self._sign != 0 or self._exp != 0: |
| 3326 | return False |
| 3327 | for dig in self._int: |
| 3328 | if dig not in '01': |
| 3329 | return False |
| 3330 | return True |
| 3331 | |
| 3332 | def _fill_logical(self, context, opa, opb): |
| 3333 | dif = context.prec - len(opa) |
no outgoing calls
no test coverage detected