Closed Bug 538172 Opened 15 years ago Closed 13 years ago

Number.toString fails for 2.274341322658976E-309

Categories

(Rhino Graveyard :: Core, defect)

x86
Linux
defect
Not set
major

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 664523

People

(Reporter: mguillemot, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.9.0.16) Gecko/2009121601 Ubuntu/9.04 (jaunty) Firefox/3.0.16
Build Identifier: 

"" + 2.274341322658976E-309

expected: 2.274341322658976E-309
actual: F.74341322658976e-310

Reproducible: Always




String conversion for numbers occurs in org.mozilla.javascript.DToA which was obviously originally written in C. Has someone already evaluated removing this class to use Java standard String conversion facilities?
I'd love it if we could compatibly jettison org.mozilla.javascript.DToA in favor of standard Java methods, but haven't looked at it.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Like bug #664523, this is fixed with the patch for bug #548857 and also works in our ported version of V8-DToA.

Regarding using Java metods like java.lang.Double.toString(): I investigated in this, but unfortunately, ES has different requirements (if I remember correctly it requires the string to represent the smallest number that will parse to the original bits).
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.