Bug 5259 - toExponential() doesn't handle enough cases
Summary: toExponential() doesn't handle enough cases
Status: RESOLVED DUPLICATE of bug 16640
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 420+
Hardware: Other All
: P2 Normal
Assignee: Maciej Stachowiak
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2005-10-04 11:15 PDT by George Staikos
Modified: 2007-12-28 15:16 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description George Staikos 2005-10-04 11:15:15 PDT
toExponential() doesn't handle: 
- no arguments 
- large arguments 
- invalid arguments 
 
FireFox passes these: 
Number(123.456).toExponential() == 1.23456e+2 
Number(123.456).toExponential(21) == 1.234560000000000030695e+2 
Number(123.456).toExponential("foo") == 1e+2 
 
I have a patch for the first case but not the rest.
Comment 1 Alexey Proskuryakov 2006-01-13 13:27:04 PST
Confirmed with ToT; the first case now works as described.
Comment 2 Sam Weinig 2007-02-23 19:25:22 PST
For the large arguments part, Firefox supports sizes up to 100, and reports a "precision <num> out of range" error for anything greater.
Comment 3 Mark Rowe (bdash) 2007-11-01 06:52:49 PDT
Another case reported on IRC:
1..toExponential(10) == 1.0000000000e+0

WebKit currently reports 1e+0.
Comment 4 Mark Rowe (bdash) 2007-11-01 06:55:04 PDT
<rdar://problem/5573382>
Comment 5 Eric Seidel (no email) 2007-12-28 15:16:58 PST
The patches attached to bug 16640 make us pass these tests.  I'm going to dup
this to bug 16640 unless there are objections.



*** This bug has been marked as a duplicate of 16640 ***