MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __float__

Method __float__

tools/python-3.11.9-amd64/Lib/_pydecimal.py:1620–1628  ·  view source on GitHub ↗

Float representation.

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

_isnanMethod · 0.95
is_snanMethod · 0.95
strFunction · 0.85

Tested by

no test coverage detected