Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: "Christoph M. Becker" Newsgroups: comp.lang.javascript Subject: Re: Date arithmetic Date: Wed, 19 Nov 2014 17:52:40 +0100 Organization: solani.org Lines: 25 Message-ID: References: <111120142237479787%timstreater@greenbee.net> <6814026.8sujcrue1K@PointedEars.de> <5592bc20-5fa3-4b2d-8534-1c81d62c31a5@googlegroups.com> <5371045.XxPr97Xf0d@PointedEars.de> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: solani.org 1416415954 24265 eJwFwQkBwDAIA0BLZSQ8cgoM/xJ6RzWxdhgNXG4J9Lg00RHWRxvULCVcruenzZuTCKmdmf8B/tMQpQ== (19 Nov 2014 16:52:34 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Wed, 19 Nov 2014 16:52:34 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 X-User-ID: eJwFwQkRwEAIBDBLLMfCVA6vfwlN+BzeYU43Hg+jL461KZ9AzDaGyb5ZlUThomccoo6Ish8e8BEV In-Reply-To: Cancel-Lock: sha1:UocSCchxfEq/lDPTNpTEpotCCLg= X-NNTP-Posting-Host: eJwFwYEBgDAIA7CXpKOFnYMg/59gwiNTh4tyLtfoZt9NH1OFCNX0G6l6nFN5gK3hRQQS7T8FoBBE Xref: csiph.com comp.lang.javascript:26162 Dr J R Stockton wrote: > In comp.lang.javascript message , Mon, 17 Nov > 2014 01:34:25, Christoph M. Becker posted: > >> My suggestion was meant to > ) ..., >> and to stick with proper integer >> calculations (what might be somewhat dangerous considering that >> ECMAScript Numbers are floating point values). > > > The Date range has been chosen such that every millisecond within the > range is represented exactly in an ECMAScript float. One only needs to > be careful not to multiply and get a result outside the allotted 10^8 > days. ACK -- assuming that there are no implementation errors. I rarely do float calculations in ECMAScript implementations, so I don't know if this assumption is reasonable. Probably it is. -- Christoph M. Becker