Tag Archives: split

Split and merge a 32-bit float with two 16-bit unsigned integers

I am sharing a code with an example that splits and merges a 32-bit float with two 16-bit unsigned integers.

Especially, when you work with an embedded system, 16-bit unsigned integer (or 8-bit unsigned integer, that is char) is a common format for data transmission. You can use this function when you want to send a 32-bit float variable with these 16-bit data format.

You can also use this function without the LSB-part. For the details, see the code below.