約 1 分鐘閱讀

IEEE 754

f32 = sign(−1 or 1)×2^(exponent−127) ×1.mantissa(fraction)

1 bit8 bit23 bit
signexponentfraction

to represent a floating number 8.5 first, we need to do a normalization

8.5 -> 8 + 0.5 -> 2^3 + (1/2)^1 -> 1000.1 (in two digit) -> +1 * 2^3 * 1.0001

+ is positive so the sign is 0 2^3 -> 3 + 127 -> 1000 0010 (exponent part) 1.0001 -> 0001 is corresponding to the fraction part. -> 0001 0000 0000 0000 0000 000

If you like my content, feel free to buy me a coffee

如果這篇筆記對你有幫助,歡迎請我喝杯咖啡支持持續寫作。

Buy Me a Coffee