Closed
Bug 444938
Opened 16 years ago
Closed 16 years ago
Javascript: Wrong addition of floats
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: tim, Unassigned)
Details
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; de; rv:1.9) Gecko/2008061004 Firefox/3.0
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; de; rv:1.9) Gecko/2008061004 Firefox/3.0
Javascript has problems with some floats. It calculates overprecise, but wrong numbers. 29.99+3 = 32.989999999999995
Reproducible: Always
Steps to Reproduce:
1. alert(29.99+3) = 32.989999999999995
2. var a = 29.99 +3; alert(a) = 32.989999999999995
3. alert(29.99+2.99+0.01) = 32.989999999999995
but
1. alert(29.99+2.01+0.99) = 32.99
2. alert(29.99+1) = 30.99
2. alert(29.99+2) = 31.99
Expected Results:
29.99 + 3 = 32.99
Summary: Javascript: Wrong addition of a floats → Javascript: Wrong addition of floats
Updated•16 years ago
|
Assignee: nobody → general
Component: General → JavaScript Engine
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → 1.9.0 Branch
Updated•16 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•