In embedded systems, floating-point values are often transmitted over UART or SPI as raw bytes. You are given a float value and must simulate how it would be serialized into 4 bytes.
Your task is to:
Example-1
Input: 1.0
Output:
Byte 0: 0
Byte 1: 0
Byte 2: 128
Byte 3: 63
Example-2
Input: -2.5
Output (example):
Byte 0: 0
Byte 1: 0
Byte 2: 32
Byte 3: 192
Input
1
Expected Output
Byte 0: 0 Byte 1: 0 Byte 2: 128 Byte 3: 63