So I recently learned the way to represent a float into a binary string, and I came across a really annoying confusion.
Lets say I have the float 10.25. In binary this would be 1010.01
Taking the exponents, this would be 1.01001 x 2^(3). So the sign bit is 0, the exponent is the unsigned 8bit binary of 127 + 3, which would become 10000010. Now for the fraction part, this should be 00000000 00000000 0001001 (23 bits)
Putting them all together, 0 10000010 00000000 00000000 0001001.
But when I put this into a conversion website, it gives me this:
It seems that the Mantissa part has been flipped by each 8 bits, maybe because of the little endian implementation. But here is the thing.
From the Big Endian Mantissa 00000000 00000000 0001001,
shouldn't the Little Endian Mantissa be 10010000 00000000 0000000?
The image says that the binary string is 0 10000010 0100100 00000000 00000000
floator adecimal number? Split your number into whole and fractional parts. Convert each to binary string digits separately and put them together afterwards.