Closed Bug 280890 Opened 20 years ago Closed 20 years ago

Trying (17.6 * 1500) gives the wrong result in Javascript

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
minor

Tracking

()

VERIFIED DUPLICATE of bug 20140

People

(Reporter: shawnd, Assigned: bugzilla)

References

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

If you try:

<script type="text/javascript">
alert(17.6*1500);
</script>

The result is displayed as 26400.000000000004.  It should be just 26400.  The
problem can be fixed by changing the expression to (((17.6*10)*1500)/10) as a
workaround.

Reproducible: Always

Steps to Reproduce:
1. Create a html file containing <html><head><script
type="text/javascript">alert(17.6*1500);</script></head></html>
2. Load the html file

Actual Results:  
It displays an alert box with the incorrect value (26400.000000000004).

Expected Results:  
Displayed an alert box with the correct value (26400).

The problem occurs on Mozilla 1.2 under RedHat Linux and Firefox 1.0 in Windows XP.

*** This bug has been marked as a duplicate of 20140 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
*** Bug 280891 has been marked as a duplicate of this bug. ***
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
See also bug 1813.

*** This bug has been marked as a duplicate of 20140 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago20 years ago
Component: General → JavaScript Engine
Product: Firefox → Core
Resolution: --- → DUPLICATE
Version: unspecified → Trunk
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.