在C语言中的小数点到底有啥用

这跟C语言本身一点关系也没有 printf(3): formatted output conversion 【在C语言中的小数点到底有啥用】 The precision
An optional precision, in the form of a period (\u0026#39;.\u0026#39;) followed by an optional decimal digit string. Instead of a decimal digit string one may write "*" or"*m$" (for some decimal integer m) to specify that the precision is given in the next argument, or in the m-th argument, respectively, which must be of typeint. If the precision is given as just \u0026#39;.\u0026#39;, or the precision is negative, the precision is taken to be zero. This gives the minimum number of digits toappear for d, i, o, u, x, and X conversions, the number of digits to appear after the radix character for a,A, e, E, f, and F conversions, the maximum number of significant digits for g and G conversions, or themaximum number of characters to be printed from a string for s and S conversions.printf - C++ ReferenceFor integer specifiers (d, i, o, u, x, X): precision specifies the minimum number of digits to be written. If the value to be written is shorter than this number, the result is padded with leading zeros. The value is not truncated even if the result is longer. A precision of 0 means that no character is written for the value 0.


    推荐阅读