Closed Bug 466822 Opened 16 years ago Closed 16 years ago

error in the sum of float

Categories

(Firefox :: General, defect)

x86
All
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 5856

People

(Reporter: diou, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.8.1.18) Gecko/20081029 Firefox/2.0.0.18
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; pt-BR; rv:1.8.1.18) Gecko/20081029 Firefox/2.0.0.18

This happens with just a few numbers

Reproducible: Always

Steps to Reproduce:
var total = 0;
total += 1.99;
document.write("0 + 1.99 = " + total + "<br>");
total += 1.08;
document.write("1.99 + 1.08 = " + total+"<br>");
Actual Results:  
0 + 1.99 = 1.99
1.99 + 1.08 = 3.0700000000000003

Expected Results:  
0 + 1.99 = 1.99
1.99 + 1.08 = 3.07
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.