Closed Bug 378956 Opened 18 years ago Closed 18 years ago

0.1 * 0.1 = 0.010000000000000002

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 5856

People

(Reporter: mouseit101, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3 In seamonkey, 0.1 * 0.1 goes wrong by a very small amount (equals 0.010000000000000002) Reproducible: Always Steps to Reproduce: 1.execute javascript outputting 0.1*0.1 2.view the answer being 0.010000000000000002 3. Actual Results: The answer was 0.010000000000000002 Expected Results: 0.1 * 0.1 = .01 Default theme
This is prolly just your common issue with any language that stores floats in binary but I'll let someone else confirm that.
Assignee: nobody → general
Component: General → JavaScript Engine
OS: Windows XP → All
Product: Firefox → Core
QA Contact: general → general
Hardware: PC → All
(oops, forgot to mention in the last comment that I was moving to Core::JavaScript Engine) Sorry for the double spam.
This is not a bug in spidermonkey, just a floating-point precision issue.
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → INVALID
damn midairs! actually a dupe of at least bug 5856! Was hoping to get to dupe to such an old bug... :-) but invalid works too.
Status: RESOLVED → VERIFIED
Actually the dupe would have been better. I wold encourage the submitter to read the explanation in bug 5856.
Agreed, not a bad dupe at all, Waldemar's explanation is fantastic, dupe away if you like.
Sorry, reopening to dupe for statistical reasons.
Status: VERIFIED → UNCONFIRMED
Resolution: INVALID → ---
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.