Closed Bug 832727 Opened 13 years ago Closed 13 years ago

Math Error in substraction

Categories

(Core :: JavaScript Engine, defect)

18 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 5856

People

(Reporter: mortchm, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0 Build ID: 20130104151925 Steps to reproduce: In javascript i did: 34.44-0.1 and 34.64-0.1 Actual results: The result of 34.44-0.1 was 34.339999999999996 The result of 34.64-0.1 was 34.54 Expected results: it should display 34.34 as in the second operation
Please provide/attach a minimal testcase (=code) here.
Flags: needinfo?(mortchm)
<script type="text/javascript"> console.log(34.44-0.1); //display 34.339999999999996 in console instead of 34.34 console.log(34.64-0.1); //display 34.54 in console as needed </script>
Flags: needinfo?(mortchm)
Please attach a full testcase (your four lines of code are not a valid HTML file) and provide complete steps how to reproduce to actually see your results (opening web console or whatever). Copying that into a file and loading it obviously shows nothing.
Flags: needinfo?(mortchm)
Andre, thanks; I managed to reproduce with Michael's script. Note that the output is in the Web Console, not on the page. However, the result you get is the expected result with IEEE doubles, afaict.
Assignee: nobody → general
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Component: Untriaged → JavaScript Engine
Flags: needinfo?(mortchm)
Product: Firefox → Core
Resolution: --- → INVALID
Resolution: INVALID → DUPLICATE
You need to log in before you can comment on or make changes to this bug.