IEEE floating point number representation. I remember learning it before, but my impression is vague. I 'd like to take a look at it .:)
This article is written by the famous "Cream Dog" on csdn.
ArticleIt is easy to understand, but unfortunately there is an error: 12345.0f should be converted to float 00 E4 40 46, and 00 20 F1 47 should represent a floating point number of 123456.0f. many friends asked this question, which is probably a clerical mistake.
Http://www.csdn.net/develop/read_article.asp? Id = 28201
In the comments, flyindanceddr also adds two points:
1. when all the exponent bits are 0, There is no hidden 1 in the data bits. At this time, the 23 bits are all 0. the next 23 digits, instead of 1. then, and the index at this time is 1-bis (when the index is 8 bits, BIS is 127)
2. When all the exponent bits are 1, no matter what the data bit is, the number is Nan, that is, the reciprocal of not a number. 0 is Nan. Nan addition, subtraction, multiplication, and division.