fload and double

Why 5f and 1.5000f are float
but
1.2 and 1.23e+2 are double?
Last edited on
CodeOpen wrote:
So are these correct?
1.234f is float
1.234L is long double
Yes.
CodeOpen wrote:
And what about this?
1.234s
If you are using std::string_literals;, it is a std::string. Otherwise, it won't compile.
http://en.cppreference.com/w/cpp/string/basic_string/operator%22%22s
LB wrote:
If you are using std::string_literals;, it is a std::string.

no, ""s for strings requires a, well, string (in quotes).
But if you're using std::chrono_literals, 1.234s is a time interval in fractional seconds.

http://en.cppreference.com/w/cpp/chrono/operator%22%22s

demo http://coliru.stacked-crooked.com/a/345fb17d92e9806f
Last edited on
Ah, my mistake.
Topic archived. No new replies allowed.