Date: Sat, 15 Dec 2012 22:24:49 +1100 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Oliver Pinter <oliver.pntr@gmail.com> Cc: Davide Italiano <davide@freebsd.org>, freebsd-current <freebsd-current@freebsd.org>, freebsd-arch@freebsd.org Subject: Re: [RFC/RFT] calloutng Message-ID: <20121215222156.H2309@besplex.bde.org> In-Reply-To: <CAPjTQNGzSDMC%2Bi1cCHjtVg_00ssoG3S-Y7szzWUbXLCMAP1zDw@mail.gmail.com> References: <CACYV=-F7_imU-JsPfeOZEyEPGKO2PVm1w1W3VdsH3jGiDvnmBg@mail.gmail.com> <CA%2BhQ2%2BgyhRHkB9Y%2BeGADvbjvJxSNSjYC%2BTQX8-0mf9LUD1V2HA@mail.gmail.com> <CACYV=-G9sG1Oo%2Bgz3kXmdeK85P7%2BZZg1CnAPLvwCuAbNftmv6A@mail.gmail.com> <CACYV=-EQ=G3JZOQ-9ExGT9spbEGtH5bJOrrgN2oeE2Qh3_rKag@mail.gmail.com> <CAPjTQNGL_7LnffWB5bbEgW0b6ekOrVzH6QQ6e2=fCFW4%2BmF6FA@mail.gmail.com> <20121215183409.U1603@besplex.bde.org> <CAPjTQNGzSDMC%2Bi1cCHjtVg_00ssoG3S-Y7szzWUbXLCMAP1zDw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 15 Dec 2012, Oliver Pinter wrote: > On 12/15/12, Bruce Evans <brde@optusnet.com.au> wrote: >> ... >> Because of the different grouping of the multiplications, the second >> is unfortunately slower (1 more multiplication that cannot be done at >> compile time). The second also gives unnecessary (but findamental to >> the method) inaccuracy by pulling out the factor of 1000. The first >> gives the same inaccuracy, and now it is because the constant is not >> correctly rounded. It should be >> >> 2.0**64 / 10**3 = 1844674407309551.616 (exactly) >> = 1844674407309552 (rounded to nearest int) >> >> but is actually rounded down to a multiple of 1000. >> ... mav@ already fixed the rounding before I wrote that :-). He also changed some (uint64_t)1's to use the long long abomination :-(. > Thanks for the detailed answer. :) Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121215222156.H2309>