OEHalfFloat

struct OEHalfFloat

This class can be used to store a 32-bit float as a 16-bit float as defined by the IEEE 754-2008 standard. Useful for reducing memory consumption when most of the data is 32-bit floating point values as the expense of precision.

Note

This is a “storage only” class, all math should still be done as float or double and then converted to 16 bits for storage.

Constructors

OEHalfFloat() -> OEHalfFloat
OEHalfFloat(data: oe_half) -> OEHalfFloat
OEHalfFloat(data: int) -> OEHalfFloat
OEHalfFloat(arg2: float) -> OEHalfFloat
OEHalfFloat(float: int) -> OEHalfFloat

Default constructors initializes to the value of 0.0. Otherwise convert the value from float, double, or long double and construct with that.

GetValue

GetValue() -> float

Retrieve the value as a 32-bit float.