zserio.float module

The module provides help methods for manipulation with float numbers.

The following float formats defined by IEEE 754 standard are supported:

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.

zserio.float.uint32_to_float(float32_value: int) float[source]

Converts 32-bit float stored as an integer value to python native float.

Parameters:

float32_value – Single precision float value stored as an integer value to convert.

Returns:

Converted python native float.

zserio.float.uint64_to_float(float64_value: int) float[source]

Converts 64-bit float stored as an integer value to python native float.

Parameters:

float64_value – Double precision float value stored as an integer value to convert.

Returns:

Converted python native float.