0
Why is the float type not the same as double?
Why is no; float a = 2.2; double b = 2.2; a == b? cout << "he" : cout << "no" ;
3 Respostas
+ 2
Because a is of float type and b is of double type. You are comparing there not of equal references. Comparing float(less type) with higher type double. .
float is of 4 bytes normally and double occupies 8 bytes..
+ 2
Андрей Петров
herre is a detailed answer:
https://stackoverflow.com/a/2386882/7959868
an example:
https://code.sololearn.com/cpKAj8sMnBIG/?ref=app