Bug 5259
Summary: | toExponential() doesn't handle enough cases | ||
---|---|---|---|
Product: | WebKit | Reporter: | George Staikos <staikos> |
Component: | JavaScriptCore | Assignee: | Maciej Stachowiak <mjs> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | ian, mrowe, sam |
Priority: | P2 | Keywords: | InRadar |
Version: | 420+ | ||
Hardware: | Other | ||
OS: | All |
George Staikos
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
Confirmed with ToT; the first case now works as described.
Sam Weinig
For the large arguments part, Firefox supports sizes up to 100, and reports a "precision <num> out of range" error for anything greater.
Mark Rowe (bdash)
Another case reported on IRC:
1..toExponential(10) == 1.0000000000e+0
WebKit currently reports 1e+0.
Mark Rowe (bdash)
<rdar://problem/5573382>
Eric Seidel (no email)
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 ***