Closed
Bug 679857
Opened 14 years ago
Closed 14 years ago
parseInt should interpret string numbers with Exponent correctly
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: antitoxic, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
Build ID: 20110615151330
Steps to reproduce:
parseInt('1e+7')
Actual results:
The result was 1
Expected results:
The result should be 10000000
Why would Math.round/abs('1e+7') equals 10000000 but parseInt('1e+7') equals 1?
Comment 1•14 years ago
|
||
The expected result in this case is wrong; this is how the JavaScript function parseInt() works. For more details see:
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseInt
http://www.w3schools.com/jsref/jsref_parseint.asp
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
| Reporter | ||
Comment 2•14 years ago
|
||
Yes, I've read here and there.
That's why I've filed another report. https://bugzilla.mozilla.org/show_bug.cgi?id=679870 which turned out to be a duplicate of https://bugzilla.mozilla.org/show_bug.cgi?id=470769
I do use the search but keywords are not always the same
You need to log in
before you can comment on or make changes to this bug.
Description
•