The IEEE754 standard describes in detail the format of single-precision floating-point numbers Chaviki Wikipedia ieee_754-1985 describes the categories that include how to express (Statute non-regulated 0 infinite NAN) and why it is so expressed
The more the number of digits, the higher the precision, and the more the digits, the larger the range is. This concept is described in physics with useful numbers . https://zh.wikipedia.org/wiki/%E6%9C%89%E6%95%88%E6%95%B0%E5%AD%97
The number of valid digits for single-precision floating-point numbers is 7 bits, and the answers are as follows:
The precision of a floating-point number depends on the part of the tail. The more digits in the number of tails, the more valid numbers can be represented. The mantissa of the single-precision number is stored with 23 bits, plus the default 1-bit 1,2^ (23+1) = 16777216 before the decimal point. Because 10^7 < 16777216 < 10^8, the effective number of single-precision floating-point numbers is 7 bits.
However, it is still not clear why the number of effective digits is 7 bits.
A number if the number of significant digits is greater than 7 bits such as 1.27893456076(12-bit), with float to indicate that can not be accurately stored.
Run:
float a = 1.23456789076f;//--->a = 1.2345679
That is, the format of 1.23456789076 stored in a float in a computer can only be approximated to the seventh bit,
It also depends on whether the number (decimal number) can be accurately represented by a finite number of bits. float = 2.202 float = 2.25
Single-precision floating-point numbers and significant digits why are 7-bit