Closed Bug 155288 Opened 22 years ago Closed 21 years ago

Multiplication of big numbers: Colon at the end of the result

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: kleinnorbert, Assigned: jst)

Details

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1a) Gecko/20020611
BuildID:    2002061104

The multiplication of some big numbers doesn't return the proper result. 
The result is nearly the right one, except the fact, that, if the last digits
are zeros, the first zero will be replaced by a colon and the digit before is
rounded off.

Reproducible: Always
Steps to Reproduce:
Type one of the following JavaScripts into the location bar of Mozilla 1.1a:
1. javascript:86400*2208257;
2. javascript:86400*2208305;
3. javascript:86400*2573772;
4. javascript:86400*3197698;
5. javascript:86400*-3350948;

Actual Results:
1. 86400*2208257 = 1907934047:0
2. 86400*2208305 = 190797551:00
3. 86400*2573772 = 2223739007:0
4. 86400*3197698 = 2762811071:0
5. 86400*-3350948 = -2895219071:0

Expected Results:
1. 86400*2208257 = 190793404800
2. 86400*2208305 = 190797552000
3. 86400*2573772 = 222373900800
4. 86400*3197698 = 276281107200
5. 86400*-3350948 = -289521907200

The bug didn't occur in version 1.0 or previous versions.
I don't know, why he does this only with some of the numbers, e.g.
javascript:86400*2208259; returns the right result. You can also try to change
the 86400 (that's the amount of seconds in a day), the problem is not limited to
multiplications with 86400.
Confirming bug with Mozilla trunk binary 2002070108 WinNT.
However, this bug is not occurring in the current JS shell.

Reassigning to DOM Level 0 for further triage -

Assignee: rogerl → jst
Component: JavaScript Engine → DOM Level 0
QA Contact: pschwartau → desale
Status: UNCONFIRMED → NEW
Ever confirmed: true
worksforme with linux build 20020701
Works with Mozilla 1.3 (win32 build 20030312)
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → WORKSFORME
Marking Verified. Using these Mozilla trunk builds on WinNT:
Build 2002-12-19 shows the bug exactly as Norbert reported.
Build 2003-03-20 has no bug: all the multiplications correct!

In retrospect, this bug was surely a duplicate of bug 140852,
"String(819187200000) == '8191871:0000' in xpcshell, browser"

The cause turned out to be a change in the compiler options 
used in the Mozilla build process on Windows, when we changed 
from the nmake system to the gmake system. Since the system
to build the JS shell never changed, that is why I was never
able to reproduce these problems in the JS shell.

Bug 140852 was fixed on 2003-02-17. Norbert: thank you for your
patience on this. If you'd like to see all the work that was done,
see bug 140852, particularly bug 140852 comment 33 and after.

Also the see the related bug 160602.

The change Mozilla Windows build system (from nmake to gmake)
was bug 58981, "Converting Windows build to gmake".
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.