W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2012

Re: Unrestricted float

From: Brendan Eich <brendan@mozilla.org>
Date: Fri, 06 Apr 2012 16:19:20 -0700
Message-ID: <4F7F79F8.5040500@mozilla.org>
To: public-script-coord@w3.org
Just as a point of sane engineering in the large over multiple past 
dependent specs, why were the meanings of float and double changed, 
rather than adding 'restricted float' and 'restricted double' types?

With typedef, verbosity can be avoided for all uses (at the cost of some 
rfloat and rdouble abbreviation).

With no change to the ancient, C-derived names' meanings, older specs 
don't break subtly or suddenly force implementations to sprout costly 
non-finite tests.

/be

Boris Zbarsky wrote:
> On 4/6/12 6:29 PM, Ian Hickson wrote:
>>> More precisely, the 'float' and 'double' types in WebIDL have been
>>> redefined to throw on non-finite floats.  There are now 'unrestricted
>>> float' and 'unrestricted double' types for cases where non-finite 
>>> floats
>>> should be passed through to the underlying method.
>>
>> Huh. First I heard of it.
>
> Yeah, we really need some mechanism to notify specs using WebIDL when 
> WebIDL changes.  :(
>
>> Everything in the HTML spec that uses floating point uses double, not
>> float. I guess that means I should be going through everything and
>> changing most of it to refer to "unrestricted double" instead of just
>> "double".
>
> Oh, interesting.  Last I'd looked at the 2d context it was using float 
> in some places.  OK, then!
>
> -Boris
>
> P.S.  I believe the typed arrays specs also need to switch to the 
> unrestricted types....
>
Received on Friday, 6 April 2012 23:19:50 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:06 UTC