I want to encode -(263.125) in base 10.
I encoded it and arrived at this solution :
11000011110000011100100000000000
I just want to make sure that it is correct.
Thank you in advance.
I want to encode -(263.125) in base 10.
I encoded it and arrived at this solution :
11000011110000011100100000000000
I just want to make sure that it is correct.
Thank you in advance.
Not quite, assuming you're trying to convert to a 32-bit IEEE-754 single-precision floating-point number. The encoding you found corresponds to:
3 2 1 0
1 09876543 21098765432109876543210
S ---E8--- ----------F23----------
Binary: 1 10000111 10000011100100000000000
Hex: C3C1 C800
Precision: SP
Sign: Negative
Exponent: 8 (Stored: 135, Bias: 127)
Hex-float: -0x1.839p8
Value: -387.5625 (NORMAL)
The correct encoding for -263.125
as a single-precision float is:
3 2 1 0
1 09876543 21098765432109876543210
S ---E8--- ----------F23----------
Binary: 1 10000111 00000111001000000000000
Hex: C383 9000
Precision: SP
Sign: Negative
Exponent: 8 (Stored: 135, Bias: 127)
Hex-float: -0x1.072p8
Value: -263.125 (NORMAL)
So, you got the sign and the exponent correct; but your fraction is not quite right.