Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <1836672.QNfzn4bpLz@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Sat, 13 Oct 2012 22:14:13 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <39e06fb5-7d74-4b5d-83bf-d2f7b3181168@googlegroups.com> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 30 NNTP-Posting-Date: 13 Oct 2012 22:14:15 CEST NNTP-Posting-Host: 15ec56e9.newsspool4.arcor-online.net X-Trace: DXC=^GAbNeECdZo_0Po7BmQ3]l4IUKK`2;Jo[T\CQbe3ijadKC]2dg X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:16607 Patricia Shanahan wrote: > RobG wrote: >> If x is an integer, then for simple rounding you are correct. But as >> Patricia said, a common rounding algorithm is to round to the nearest >> even number (sometimes called "bankers rounding") to attenuate >> rounding inaccuracy. > > It's perhaps worth emphasizing the fact that the ties go to nearest even > style of rounding is the normal rounding mode in JavaScript arithmetic. ^^^^^^^^^^ That would be _ECMAScript_.¹ But you are oversimplifying, see ES 5.1 §9.8.1. One additional caveat here is that the numbers you *see* are only string representations of Number values. BTW, your quoting style is suboptimal. Omissions, if any, should be indicated at the same quotation level as the text from which text has been omitted. `[...]' or (typographically correct) `[…]' should be used to indicate omission, to distinguish it from an ellipsis in the quoted text. PointedEars ___________ ¹ But perhaps one should be grateful already that you are not writing "Javascript" or "javascript" instead. Sigh. [psf 10.1] -- Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network. -- Tim Berners-Lee