Re: [RFC/RFT] calloutng

From: Bruce Evans <brde_at_optusnet.com.au>
Date: Sat, 15 Dec 2012 22:24:49 +1100 (EST)
On Sat, 15 Dec 2012, Oliver Pinter wrote:

> On 12/15/12, Bruce Evans <brde_at_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_at_ 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
Received on Sat Dec 15 2012 - 10:24:54 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:33 UTC