Re: Unrestricted float

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