Why floating point value such as 3.14 are considered as double by default in MSVC?

前端 未结 5 1759
逝去的感伤
逝去的感伤 2020-11-27 08:27

Why do I need to put 3.14f instead of 3.14 to disable all those warnings ? Is there a coherent reason reason for this ?

5条回答
  •  没有蜡笔的小新
    2020-11-27 08:46

    This is probably a standard in C world. Double is preferred since it's more precise and you probably won't see any performance differences. Read this post.

提交回复
热议问题