Date: Fri, 24 Oct 2003 21:09:13 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= <des@des.no> Cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/lib/msun/src fabsl.c Message-ID: <20031024205226.V9644@gamplex.bde.org> In-Reply-To: <xzpy8vbaukq.fsf@dwp.des.no> References: <200310230820.h9N8KlSD025966@repoman.freebsd.org> <20031024083336.GA10360@VARK.homeunix.com> <xzpy8vbaukq.fsf@dwp.des.no>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 24 Oct 2003, Dag-Erling [iso-8859-1] Sm=F8rgrav wrote: > David Schultz <das@FreeBSD.ORG> writes: > > Cool. This has a minor bug in that it does the wrong thing for -0. I reported this and some style bugs. > I'd like to use your solution[1] instead, but it requires quite a bit > more work as fpmath.h isn't normally installed. Suboptimimal solutions are easy: =09return (x < 0 ? -x : x =3D=3D 0 ? 0 : x); This is about twice as suboptimal as the current version (2 comparisons instead of 1). This also fixes a style bug that I missed before: missing spaces around return value. This is not bug for bug compatible with the fdlibm style, but neither is the current version. Spaces around most binary operators must be omitted for full compatibility. BTW, the classification stuff in <math.h> gives a lot of namespace pollution in the _ANSI_SOURCE case. <math.h> is not correctly ifdefed for C99, but it used to be correctly ifdefed for C90. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031024205226.V9644>