Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.albasani.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 23:40:25 +0100 Organization: solani.org Lines: 24 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 1416436817 3490 eJwFwQERADEIAzBLz1gLyCkc8y/hEziNE5fgxcOr3FDixO4pSkCGvpkOrlbTNF/ko2hdHj8kxhF1 (19 Nov 2014 22:40:17 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Wed, 19 Nov 2014 22:40:17 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 X-User-ID: eJwFwQkRADAIAzBLsJUCcnhu/iUssUvlOGiEPXtax7ajIORMbdecyTCvRgugeh+F2A1P3/wn+hEq In-Reply-To: Cancel-Lock: sha1:bOOSzeLOF0nlxj9XTGN8Toze9bU= X-NNTP-Posting-Host: eJwNwokRACEIBLCWlpPlKQdR+i/Bm4TLxNrVaMrh3HR1YH5nuuIQ4/h21kZ53D6QllxiQZTaAyHVEPM= Xref: csiph.com comp.lang.javascript:26173 Gene Wirchenko wrote: > On Wed, 19 Nov 2014 17:52:40 +0100, "Christoph M. Becker" > wrote: > > [snip] > >> 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. > > Since it is the only number type available for variables, how do > you avoid it? I meant "I rarely do divisions, that need to be exact, in ECMAScript implementations" (and should have written that -- sorry). Either a potentially unexact result wouldn't do harm (for instance, when setting certain CSS properties) or I deliberately round the result. Furthermore I do the server-side programming in PHP, so some of the calculations are redone there, anyway, so I don't mind potentially unexact temporary results in buggy ECMAScript implementations. -- Christoph M. Becker