Float representation.
(self)
| 1618 | return other.__floordiv__(self, context=context) |
| 1619 | |
| 1620 | def __float__(self): |
| 1621 | """Float representation.""" |
| 1622 | if self._isnan(): |
| 1623 | if self.is_snan(): |
| 1624 | raise ValueError("Cannot convert signaling NaN to float") |
| 1625 | s = "-nan" if self._sign else "nan" |
| 1626 | else: |
| 1627 | s = str(self) |
| 1628 | return float(s) |
| 1629 | |
| 1630 | def __int__(self): |
| 1631 | """Converts self to an int, truncating if necessary.""" |