c/c++ notation of double floating point values

前端 未结 2 1776
醉酒成梦
醉酒成梦 2020-12-21 19:38

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.0

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-21 20:30

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

    And here is the link to reference document: http://en.cppreference.com/w/cpp/language/floating_literal

提交回复
热议问题