Something weird
Unsolved
General and Desktop
-
When I run case 1, the console output is "True";
But when I run case 2, the console output is "False"I can't figure it out, somebody help me plz
====== Case 1 =========
QVector <int> av;
int max = 54;av.append(9);
av.append(6);if(av.at(0) * av.at(1) == max)
qDebug("True");
else
qDebug("False");====== Case 2: =========
QVector <double> av;
double max = 0.54;av.append(0.9);
av.append(0.6);if(av.at(0) * av.at(1) == max)
qDebug("True");
else
qDebug("False"); -
Hi
try to do
qDebug() << av.at(0) * av.at(1);It works here but i guess its random.
http://floating-point-gui.de/