DLPU057A March 2018 – April 2022 DLP3030-Q1
Let us assume the received values of bytes be 0x00, 0x00, 0x80, 0x3E respectively.
Step 1: Concatenating them in the correct order we get 0x3E800000
Step 2: Store 0x3E800000 into a 32 bit integer (say Uint32 DataInt).
Step 3: Use a 32 bit float pointer to access the integer.
float32* DataFlt= (float32*) & DataInt
Step 4: The value of the float pointer contains the actual value of Data.
float32 Data = * DataFlt;
We can see that the value of Data is 1.0,
Note: The above examples are just a description of the procedure. Different processors may store the float values in different ways.