Memory structure of floating point

xiaoxiao2021-03-06  42

According to the standard of IEEE, the definition of floating point is as follows

Symbolic index number fractional partial index offset single precision floating point 1 bit [31] 8 bits [30-23] 23-bit [22-00] 127 double precision floating point number [63] 11 bits [62-52] 52-bit [51-00] 1023

We explain the number of single-precision floating point: symbolic position, the positive or negative index of the floating point number is actually positive, but there is no separate symbol bit, but use an offset to represent the world, carry It is also binary, index represents 2 N power this data format, index is 8 bits, and the scope of expression is 0 to 255 and the corresponding actual index is -127 to 128 here, - 127 and 128 These two data are reserved as a number of -127 represented by a variety of purposes in IEEE. The number of 0128 and other digits represents a variety of meaning. The most typical is the NAN status fraction, not a floating point actual The actual decimal decimal in front of this decimal is 1 1 floating point number 1.0, the symbol bit is 0, the actual index is 0, corresponding to the index here is 127, that is, 0x7f and the fractional part is 1.0, 1 is The implied non-stored, the actual fractional part is 0, therefore the combined data is that 0x3F80000 can be represented by a class: class floattype {public: union {dWord m_dwint; float m_ffloat; structure {

INT M_NFRA: 23; INT M_NEXP: 8;

Bool M_Bsign: 1;};

转载请注明原文地址:https://www.9cbs.com/read-61356.html

New Post(0)