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

Method __float__

Lib/_pydecimal.py:1561–1569  ·  view source on GitHub ↗

Float representation.

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

_isnanMethod · 0.95
is_snanMethod · 0.95
strFunction · 0.85

Tested by

no test coverage detected