MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / __float__

Method __float__

python/dolfinx/fem/function.py:86–91  ·  view source on GitHub ↗

Real representation of the constant.

(self)

Source from the content-addressed store, hash-verified

84 return np.dtype(self._cpp_object.dtype)
85
86 def __float__(self) -> float:
87 """Real representation of the constant."""
88 if self.ufl_shape or self.ufl_free_indices:
89 raise TypeError("Cannot evaluate a nonscalar expression to a scalar value.")
90
91 return float(self.value)
92
93 def __complex__(self) -> complex:
94 """Complex representation of the constant."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected