[WebIDL] Comments on [Clamp]

Two things about [Clamp] (one of which I've already mentioned to Cameron.)
(I've used byte for the examples here.)

1. Can we make it explicit that -0 is converted to 0?  It is not clear to
me that the steps

   1. Round x to the nearest integer, choosing the even integer if it lies
   halfway between two.
   2. Set x to min(max(x, −27), 27 − 1).

preclude x from being -0.

2. Can we reorder the steps so that the clamping happens before the
rounding?  e.g.

   1. Set x to min(max(x, −27), 27 − 1).
   2. Round x to the nearest integer, choosing the even integer if it lies
   halfway between two.

This doesn't actually change the results, but it is easier to read IMO.  It
also doesn't require us to wrap our heads around what "round" means for
infinities.

- Kyle

Received on Monday, 11 June 2012 02:05:45 UTC