Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 03 Mar 2018 14:02:50 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Hans Petter Selasky <hselasky@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r330352 - in head/sys/compat/linuxkpi/common: include/linux src
Message-ID:  <1520110970.23690.20.camel@freebsd.org>
In-Reply-To: <20180303204913.GI3194@kib.kiev.ua>
References:  <201803031854.w23IsHxm086835@repo.freebsd.org> <1520104482.23690.15.camel@freebsd.org> <20180303204913.GI3194@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 2018-03-03 at 22:49 +0200, Konstantin Belousov wrote:
> On Sat, Mar 03, 2018 at 12:14:42PM -0700, Ian Lepore wrote:
> > 
> > To really avoid roundoff errors, use mstosbt(ms) instead of SBT_1MS*ms.
> > 
> > The rounding errors when multiplying or dividing by SBT_1MS is not
> > severe like it is with SBT_1NS, but the inline functions still do the
> > arithmetic more correctly to avoid roundoff error.
> BTW mstosbt() and other functions have weird bracing in the formula. I
> think that the formula as calculated by the C operator precedence is
> fine, i.e. multiplication is done before right shift. But the bracing
> is redundand then, because the '()' pair next to the return () braces by
> inclusion is tautological.
> 

Oh, on looking closer, it's not a paste-o, I just didn't put the
closing paren where I had intended to for making it clear the shift
happens last.  (So almost everyone except me is still going to think a
fix has redundant parens.)

-- Ian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1520110970.23690.20.camel>