zserio.float module¶
The module provides help methods for manipulation with float numbers.
The following float formats defined by IEEE 754 standard are supported:
half precision float point format (https://en.wikipedia.org/wiki/Half-precision_floating-point_format)
single precision float point format (https://en.wikipedia.org/wiki/Single-precision_floating-point_format)
double precision float point format (https://en.wikipedia.org/wiki/Double-precision_floating-point_format)
- zserio.float.float_to_uint16(float64: float) int [source]¶
Converts python native float to 16-bit float stored as integer value.
- Parameters:
float64 – Python native float to convert.
- Returns:
Converted half precision float value stored as an integer value.
- zserio.float.float_to_uint32(float64: float) int [source]¶
Converts python native float to 32-bit float stored as integer value.
- Parameters:
float64 – Python native float to convert.
- Returns:
Converted single precision float value stored as an integer value.
- zserio.float.float_to_uint64(float64: float) int [source]¶
Converts python native float to 64-bit float stored as integer value.
- Parameters:
float64 – Python native float to convert.
- Returns:
Converted double precision float value stored as an integer value.
- zserio.float.uint16_to_float(float16_value: int) float [source]¶
Converts 16-bit float stored as an integer value to python native float.
- Parameters:
float16_value – Half precision float value stored as an integer value to convert.
- Returns:
Converted python native float.