Javascript multiplication of float values produces incorrect result

VERIFIED DUPLICATE of bug 5856

Status

()

VERIFIED DUPLICATE of bug 5856
14 years ago
9 years ago

People

(Reporter: j_lozinski, Unassigned)

Tracking

1.7 Branch
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050128 Firefox/1.0 (Ubuntu) (Ubuntu package 1.0+dfsg.1-2ubuntu5)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050128 Firefox/1.0 (Ubuntu) (Ubuntu package 1.0+dfsg.1-2ubuntu5)

When multiplying the float value 2.3 by 100 the values are incorrect.
example 2.3 * 100 is not 230, but 229.99999999997:



Reproducible: Always

Steps to Reproduce:
alert(2.3*100) => result expected 230, actual 229.99999999997
alert(2.33*100) => result expected 233, actual 233
alert(2.29*100) => result expected 229, actual 229.99999999997
Actual Results:  
values are not always correct

Expected Results:  
values are correct always

does not appear to be true for epiphany, (Mozilla/5.0 (X11; U; Linux i686;
en-US; rv:1.7.5) Gecko/20050128 Epiphany/1.5.5 (Ubuntu) (Ubuntu package
1.0+dfsg.1-2ubuntu5))

Updated

14 years ago
Assignee: firefox → general
Component: General → JavaScript Engine
Product: Firefox → Core
QA Contact: general → pschwartau
Version: unspecified → 1.7 Branch
This is a dup of bug 190303, which is itself probably an unmarked dup of a much
older bug.

/be

*** This bug has been marked as a duplicate of 190303 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → DUPLICATE
The older bug is bug 5856, so anyone feeling strongly about it, feel free to
reopen and redup this bug and bug 190303.

/be

Updated

9 years ago
Duplicate of bug: 5856

Updated

9 years ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.