MCPcopy Index your code
hub / github.com/python/cpython / __float__

Method __float__

Lib/_pydecimal.py:1564–1572  ·  view source on GitHub ↗

Float representation.

(self)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 3

_isnanMethod · 0.95
is_snanMethod · 0.95
strFunction · 0.85

Tested by

no test coverage detected