cvs commit: src/lib/msun/src s_cimag.c s_cimagf.c s_cimagl.c s_conj.c s_conjf.c s_conjl.c

Gabor Kovesdan gabor at
Thu Aug 7 15:09:33 UTC 2008

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?


More information about the cvs-all mailing list