Re: [WebIDL] double

On Mon, 15 Jun 2009, Cameron McCormack wrote:
> Ian Hickson:
> > How do I know when to use float or double, for types that are supposed to 
> > represent infinite range? Should I just make everything double?
> 
> If you want more range, sure, use double.  Web IDL doesn’t have an 
> arbitrary precision numeric type.  But double specifically means 64-bit 
> IEEE 754 double precision floating point, here, which is just what JS 
> Number is (except for the NaNs).

Oh. Wouldn't it make more sense for JS compatiblility to have float be 
64-bit? It seems bad to have a type that is 32-bit but then have its most 
common implementation not throw an exception or anything if setting a 
number that is 64-bit into it. (Or do UAs treat 'float's as 32-bit and 
trim the numbers when storing them?)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Monday, 15 June 2009 00:08:46 UTC