什么是C的printf%F默认precision? [英] What is c printf %f default precision?

查看:229
本文介绍了什么是C的printf%F默认precision?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇:

如果你做了的printf(%F号); 什么是语句的precision?即有多少小数会出现?这是编译器相关的?

If you do a printf("%f", number); what is the precision of the statement? I.e. How many decimal places will show up? Is this compiler dependent?

推荐答案

ANSI C标准,在第7.9.6.1说,这对F格式说明:

The ANSI C standard, in section 7.9.6.1, says this about the f format specifier:

如果在precision丢失,6位给予

If the precision is missing, 6 digits are given

这篇关于什么是C的printf%F默认precision?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆