C中printf()格式代码%g、%f、%e

%f

Decimal floating point:十进制浮点数(单、双精度)。

%e

Scientific notation (mantissa/exponent):科学记数法(尾数/指数)。保留小数点后六位。

%g

Use the shortest representation: %e or %f。
至多6位有效数字,去除多余的0。
当指数大于等于6或小于等于-5时,使用%e。

发布了5 篇原创文章 · 获赞 0 · 访问量 2547

猜你喜欢

转载自blog.csdn.net/yyy_hr/article/details/93729670