Date: Thu, 07 Aug 2008 16:49:42 +0200 From: Gabor Kovesdan <gabor@kovesdan.org> To: David Schultz <das@FreeBSD.org> Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/msun/src s_cimag.c s_cimagf.c s_cimagl.c s_conj.c s_conjf.c s_conjl.c Message-ID: <489B0B86.5090307@kovesdan.org> In-Reply-To: <200808071440.m77Ee0mA057169@repoman.freebsd.org> References: <200808071440.m77Ee0mA057169@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
David Schultz ha scritto: > das 2008-08-07 14:39:56 UTC > > FreeBSD src repository > > Modified files: > lib/msun/src s_cimag.c s_cimagf.c s_cimagl.c s_conj.c > s_conjf.c s_conjl.c > Log: > SVN rev 181374 on 2008-08-07 14:39:56Z by das > > Use cpack() and the gcc extension __imag__ to implement cimag() and > conj() instead of using expressions like z * I. The latter is bad for > several reasons: > > 1. It is implemented using arithmetic, which is unnecessary, and can > generate floating point exceptions, contrary to the requirements on > these functions. > > 2. gcc implements complex multiplication using a formula that breaks > down for infinities, e.g., it gives INFINITY * I == nan + inf I. > I've also checked that this part was a bit messy and incomplete and I've thought of working on this, thus I'm happy to see that you are working on improving the C99 complex.h support. My only concern is that, is it a good idea to use GCC extensions in our libc? Isn't this a significant limit of the portability? Regards, Gábor
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?489B0B86.5090307>