Floating-point numeral.
| 3196 | |
| 3197 | |
| 3198 | class FPNumRef(FPRef): |
| 3199 | """Floating-point numeral.""" |
| 3200 | |
| 3201 | __slots__ = () |
| 3202 | |
| 3203 | def as_string(self) -> str: |
| 3204 | return repr(self) |
| 3205 | |
| 3206 | def isNaN(self) -> bool: |
| 3207 | if isinstance(self._ast, FpLitNode): |
| 3208 | return math.isnan(struct.unpack("<d", struct.pack("<Q", self._ast.bits))[0]) |
| 3209 | return False |
| 3210 | |
| 3211 | def isInf(self) -> bool: |
| 3212 | if isinstance(self._ast, FpLitNode): |
| 3213 | return math.isinf(struct.unpack("<d", struct.pack("<Q", self._ast.bits))[0]) |
| 3214 | return False |
| 3215 | |
| 3216 | def isZero(self) -> bool: |
| 3217 | if isinstance(self._ast, FpLitNode): |
| 3218 | return struct.unpack("<d", struct.pack("<Q", self._ast.bits))[0] == 0.0 |
| 3219 | return False |
| 3220 | |
| 3221 | |
| 3222 | class FPRMRef(ExprRef): |
no outgoing calls
no test coverage detected