Closed
Bug 699645
Opened 14 years ago
Closed 14 years ago
[Javascript] Wrong comparision (0.55*100 == 55) always return false
Categories
(Firefox :: General, defect)
Tracking
()
People
(Reporter: nghiad85, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1
Steps to reproduce:
In my code there is one compassion like
var x = 0.55
if (x*100 == 55) {
// do something
}
Actual results:
There is no way to make the condition to true.
Expected results:
0.55*100 == 55 should return true
Comment 1•14 years ago
|
||
Learn about floating point number calculation.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
Ok, my question is
Why 0.33*100 returns 33 but 0.55*100 returns 55.00000000000001.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Updated•14 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago → 14 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•