This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix cexp when both real and imaginary parts of x arenon-finite
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Mark H Weaver <mhw at netris dot org>
- Cc: <libc-alpha at sourceware dot org>
- Date: Tue, 31 Jul 2012 22:07:05 +0000
- Subject: Re: [PATCH] Fix cexp when both real and imaginary parts of x arenon-finite
- References: <874non3c2e.fsf@netris.org>
On Tue, 31 Jul 2012, Mark H Weaver wrote:
> The default implementations of cexp, cexpf, and cexpl are broken when
> the real part of x is infinite and the imaginary part is non-finite
> (infinite or NaN).
>
> In these cases, the complex phase of the result is indeterminate, and
> thus the only two sensible results are 0.0 + i*0.0 (when the real part
> of x is negative infinity) or NaN + i*NaN in all other cases.
I believe the present results are in accordance with what C99 and C11
(Annex G) specify (which includes that certain signs in the result are
unspecified), and that the testcases in libm-test.inc properly verify the
C99 specifications (hence for example using IGNORE_ZERO_INF_SIGN in
certain cases). I'd have expected your patch to fail testing.
--
Joseph S. Myers
joseph@codesourcery.com