双浮点值的c / c ++符号 [英] c/c++ notation of double floating point values

查看:113
本文介绍了双浮点值的c / c ++符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



.5 表示双精度浮点值或浮点值?



我很确定2.0f被解析为浮点数和2.0作为双倍,但是.5?



http://c.comsci.us/etymology/literals.html

解决方案

是双倍的。用f进行后缀以获得浮动。


What's the notation for double precision floating point values in C/C++?

.5 is representing a double or a float value?

I'm pretty sure 2.0f is parsed as a float and 2.0 as a double but what about .5?

http://c.comsci.us/etymology/literals.html

解决方案

It's double. Suffix it with f to get float.

这篇关于双浮点值的c / c ++符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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