Should we generally use float literals for floats instead of the simpler double literals?

后端 未结 7 841
轻奢々
轻奢々 2020-11-29 04:47

In C++ (or maybe only our compilers VC8 and VC10) 3.14 is a double literal and 3.14f is a float literal.

Now I have a colleague

7条回答
  •  失恋的感觉
    2020-11-29 05:01

    I personally tend to use the f postfix notation as a matter of principles and to make it obvious as much as I can that this is a float type rather than a double.

    My two cents

提交回复
热议问题