Why is the sum of an int and a float an int? – stackoverflow.com

float d = 3.14f; int i = 1; auto sum = d + i; The sum is 4. Why does this happen? According to cpp reference, int will be converted to float.

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

0 Comment to "Why is the sum of an int and a float an int? – stackoverflow.com"