[RFC/RFT] calloutng

Bruce Evans brde at optusnet.com.au
Sat Dec 15 11:24:54 UTC 2012


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@ 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


More information about the freebsd-arch mailing list