Float representation.
(self)
| 1562 | return other.__floordiv__(self, context=context) |
| 1563 | |
| 1564 | def __float__(self): |
| 1565 | """Float representation.""" |
| 1566 | if self._isnan(): |
| 1567 | if self.is_snan(): |
| 1568 | raise ValueError("Cannot convert signaling NaN to float") |
| 1569 | s = "-nan" if self._sign else "nan" |
| 1570 | else: |
| 1571 | s = str(self) |
| 1572 | return float(s) |
| 1573 | |
| 1574 | def __int__(self): |
| 1575 | """Converts self to an int, truncating if necessary.""" |