Re: [css3-mediaqueries] feedback on device-aspect-ratio, aspect-ratio and orientation

On Fri, Oct 31, 2008 at 9:15 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> Almost this exact discussion came up on the WHATWG list about <video> aspect
> ratios.  ^_^  Ian has so far kept the aspect ratio a float.  His argument is
> that the precision with which we store floats is *vastly* greater than the
> differences between aspect ratios in use today or in the relatively near
> future, and so the difference between a given ratio and the
> closest-approximation float is irrelevant.  (And by the time they might get
> close, we can just upgrade it to a 64-bit float or something.)

The use-cases are different.  In HTML5, a float is used to scale a
video.  If the video is scaled to 1.333 instead of 1.3333..., nobody
will notice: that's almost certainly a subpixel difference, or if it
isn't, it's so few pixels as to be negligible.  In CSS, a float would
be used for *equality testing*, and floats just don't work for
equality testing.  As the standard warning goes, you should never
compare floats for equality: you have to do something like x - y <=
0.00001, not x == y.  If floats were used here, the standard would
have to specify what sort of equality testing would be used.

Received on Friday, 31 October 2008 15:12:18 UTC