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" ;

24th Nov 2019, 6:31 PM
ŠŠ½Š“рŠµŠ¹ ŠŸŠµŃ‚Ń€Š¾Š²
ŠŠ½Š“рŠµŠ¹ ŠŸŠµŃ‚Ń€Š¾Š² - avatar
3 Answers
+ 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..
24th Nov 2019, 9:14 PM
Jayakrishna šŸ‡®šŸ‡³