The article will combine fixed-length floating-point data to represent the base value of the mantissa
When the machine word length is the same, using floating-point numbers to represent real numbers has a larger representable range than using fixed-point numbers to represent. Many machines use the following format to represent a floating-point number. The order code part in the figure includes two parts: the order symbol and the order value. It is worth noting that in the p+1-bit order code part, only p actually affects the order value. bit.
In mathematics, real numbers are distributed continuously on the number line. However, for the limited word length of the machine, floating-point numbers can only represent some discrete values scattered on the positive and negative intervals on the number axis, as shown in the following figure:
The number of bits p of the order value of the floating-point number mainly affects the size of the two representable areas, that is, the range of numbers that can be represented, while the number of bits m of the mantissa mainly affects the precision of the value that can be represented in the representable area. Due to the limited number of digits, errors will inevitably occur, and the size of the error is related to the number of digits m.
We discuss the impact of the choice of the base value for the mantissa of floating-point numbers, in terms of the base for representing floating-point numbers. Then the number in base is . When the number of digits of the machine is m, it is equivalent to a number of digits in the mantissa of the base system , and its digit weights are , ..., to the right . where m'=m/ .
The floating-point number that is considered as the base value of the mantissa is to add 1 to the exponent to keep the value unchanged when the mantissa is shifted to the right by one base digit. The following table lists the general format of various characteristic parameters of floating-point numbers under the conditions of non-negative order, positive mantissa, and normalization using binary p bits for the order value and base m' bits for the mantissa.
The normalized positive mantissa refers to the number whose first base digit after the decimal point of the positive mantissa is not 0. Because the number whose mantissa is all 0 is machine zero, it is not a representable number in the machine. Therefore, the smallest positive mantissa value should be the value in which the first decimal digit after the decimal point of the decimal mantissa is 1, and the other digits are all 0, that is , the largest mantissa is 1- .
Since it is a non-negative order, the minimum order should be that the order value is all 0, so the minimum order is 0, and the maximum order should be all 1, so the maximum order is -1, and the order value is from 0 to -1 of total .
According to the meaning of the floating-point number representation format, the value of the floating-point number is: order value X mantissa value, then the maximum number and the minimum number can be obtained from the above summary.