« Bugzilla Issues Index
#305 — 15.7.4.6: Bugs in Number.prototype.toExponential algorithm
- bug_id:
305
- creation_ts:
2012-03-12 17:52:00 -0700
- short_desc:
15.7.4.6: Bugs in Number.prototype.toExponential algorithm
- delta_ts:
2012-05-04 14:52:13 -0700
- product:
Draft for 6th Edition
- component:
technical issue
- version:
Rev 6: February 2012 Draft
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
FIXED
- priority:
Normal
- bug_severity:
normal
- dependson:
301
- everconfirmed:
true
- reporter:
Allen Wirfs-Brock
- assigned_to:
Allen Wirfs-Brock
- cc:
dox.jin
- commentid:
751
- comment_count:
0
- who:
Allen Wirfs-Brock
- bug_when:
2012-03-12 17:52:28 -0700
+++ This bug was initially created as a clone of Bug #301 +++
When this Number value is 0 and fractionDigits > 0, according to the algorithm in 15.7.4.6, result is wrong. For example, here are the steps taken for (0).toExponential(1):
1. x = 0
2. f = 1
3. skip
4. s = ""
5. skip
6. skip
7. skip
8. then
a. f = 0
b. m = "0"
c. e = 0
9. skip
10. skip
11. then
a. c = "+"
b. d = "0"
12. skip
13. m = "0e+0"
14. return "0e+0"
The step 8.a "a. Let f = 0." should be "a. if fractionDigits is undefined, then let f = 0.".
- commentid:
752
- comment_count:
1
- who:
Allen Wirfs-Brock
- bug_when:
2012-03-12 17:53:20 -0700
This is an ES5 bug that also needs to be repaired in ES6
- commentid:
893
- comment_count:
2
- who:
Allen Wirfs-Brock
- bug_when:
2012-05-04 14:52:13 -0700
fixed in May 4 2012 draft