Skip to main content

EitherFloat

This class represents a value that can be either a native 64-bit float or a Python float object. It provides a way to handle floating-point data across the boundary between native code and the Python runtime.

Attributes

AttributeTypeDescription
F64f64Stores a native Rust 64-bit floating-point value for high-performance numerical operations.
PyBound< 'py, PyFloat >Stores a reference to a Python float object for interoperability with the Python runtime.

Constructor

Signature

def F64(
value: f64
) - > [EitherFloat](eitherfloat.md?sid=input_return_enums_eitherfloat)

Parameters

NameTypeDescription
valuef64The 64-bit floating-point primitive to be wrapped.

Signature

def Py(
value: Bound< 'py, PyFloat >
) - > [EitherFloat](eitherfloat.md?sid=input_return_enums_eitherfloat)

Parameters

NameTypeDescription
valueBound< 'py, PyFloat >The bound reference to the Python float object being wrapped.