« Bugzilla Issues Index
#3582 — 7.1.* ToInt32, etc. : not clear what should be produced by -0.2
- bug_id:
3582
- creation_ts:
2015-01-21 01:38:00 -0800
- short_desc:
7.1.* ToInt32, etc. : not clear what should be produced by -0.2
- delta_ts:
2015-02-02 18:38:48 -0800
- product:
Draft for 6th Edition
- component:
technical issue
- version:
Rev 31: January 15, 2015 Draft
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
FIXED
- priority:
Normal
- bug_severity:
enhancement
- dependson:
3581
- everconfirmed:
true
- reporter:
Claude Pache
- assigned_to:
Allen Wirfs-Brock
- commentid:
11572
- comment_count:
0
- who:
Claude Pache
- bug_when:
2015-01-21 01:38:03 -0800
For To[U]Int{32, 16, 8} abstract operations, there is a similar issue to ToInteger (Bug 3581); but in those algorithms, the intended output is +0 rather than -0.
I suggest the following formulation, which make super-clear the intent around -0:
1. Let int be ToInteger(argument).
2. ReturnIfAbrupt(int).
3. If int is -0, let int be +0.
4. (proceed with current steps 5-6).
(The above does not apply to ToUInt8Clamp, which is fine.)
- commentid:
11602
- comment_count:
1
- who:
Allen Wirfs-Brock
- bug_when:
2015-01-22 16:09:47 -0800
and also, unlike ToInteger, +/- infinity is not preserved.
- commentid:
11603
- comment_count:
2
- who:
Allen Wirfs-Brock
- bug_when:
2015-01-22 16:23:49 -0800
fixed in rev32 editor's draft
I copied the new ToInteger langue into step 4 of each. I think they are easier to understand when everything except ToNumber is done in-line.
- commentid:
11922
- comment_count:
3
- who:
Allen Wirfs-Brock
- bug_when:
2015-02-02 18:38:48 -0800
fixed in rev32 draft