Re: [DOM3 Events] Error between float vs. double of WheelEvent

On 2012/03/18 11:45, Glenn Maynard wrote:
> On Sat, Mar 17, 2012 at 8:57 PM, Masayuki Nakano <masayuki@d-toybox.com
> <mailto:masayuki@d-toybox.com>> wrote:
>
>     E.g., following function returns false when I defined them as float.
>
>     function () {
>       var event = new WheelEvent("wheel", { deltaX: 1.0 });
>       return (event.deltaX == 1.0);
>     }
>
>     because the deltaX becomes 1.000000xxxxxxxxx (x means random number)
>     by the error.
>
>
> (I'd expect this to happen with 0.1, but 1.0 is exactly representable by
> both floats and doubles...)

I'm sorry, it's just my mistake. You're right.

-- Masayuki Nakano <masayuki@d-toybox.com> Manager, 
Internationalization, Mozilla Japan.

Received on Monday, 19 March 2012 04:58:23 UTC