[whatwg] valueAsNumber: float is not enough

TAMURA, Kent tkent at chromium.org
Tue Jan 26 00:07:43 PST 2010


          attribute float valueAsNumber  

valueAsNumber is defined as float, IEEE754 single precision number.
It should be double because number values for date and time types are
milliseconds from UNIX epoch.  As of today, milliseconds from UNIX epoch is
about 1,264,492,163,000.  The float type can't represent this value
If we do the following with float valueAsNumber, the input value loses the
   input.type = "datetime";
   input.value = "2010-01-26T08:00Z";
   var num = input.valueAsNumber;
   input.valueAsNumber = num;

Software Engineer, Google

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100126/2c6e00a8/attachment-0002.htm>

More information about the whatwg mailing list