In the snippet below, auto
deduces the variable to double
, but I want float
.
auto one = 3.5;
Does it always use double
for literals with a decimal point? How does it decide between float and double?
Type of literal 3.5
is double
. For float
please use 3.5f
You can play with this snippet to see various type information.