Closed Bug 320093 Opened 19 years ago Closed 19 years ago

In javascript 0.7+0.2=0.8(9)

Categories

(Core :: JavaScript Engine, defect)

1.0 Branch
x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 5856

People

(Reporter: viktor.yarmak, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

Invalid handling of mathematical operations: 0.7+0.2=0.8(9)


Reproducible: Always

Steps to Reproduce:
1. Create new document with javascript "alert(0.7+0.2);" or open a javascript console and put alert(0.7+0.2); to evaluate

Actual Results:  
0.8999999999999

Expected Results:  
I expect that result will be 0.9!!! :)
Assignee: nobody → general
Component: General → JavaScript Engine
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → 1.0 Branch

*** This bug has been marked as a duplicate of 5856 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
See my blog item at http://weblogs.mozillazine.org/roadmap/archives/008325.html -- obviously we would help a number of users by somehow switching to decimal mode arithmetic.  The problem is backward compatibility.  If you are willing to write a pragma (JS2/ECMAScript Edition 4 proposed syntax):

    use arithmetic decimal;

then you'd be all set in the rest of the script in which that pragma occurred.

/be
You need to log in before you can comment on or make changes to this bug.