re PR fortran/8587 ((double complex zero)**(double prec number) = NAN instead of zero)

2002-11-19  Toon Moene  <toon@moene.indiv.nluug.nl>

	PR fortran/8587
	* libF77/pow_zz.c: Handle (0.0, 0.0) ** power.

2002-11-19  Toon Moene  <toon@moene.indiv.nluug.nl>

	PR fortran/8587
	* news.texi: Show PR fortran/8587 fixed.

From-SVN: r59280
This commit is contained in:
Toon Moene 2002-11-20 00:17:36 +01:00 committed by Toon Moene
parent efcc70370b
commit 27dcc451f4
4 changed files with 19 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2002-11-19 Toon Moene <toon@moene.indiv.nluug.nl>
PR fortran/8587
* news.texi: Show PR fortran/8587 fixed.
2002-11-19 Jason Thorpe <thorpej@wasabisystems.com>
* g77spec.c (lang_specific_spec_functions): New.

View file

@ -10,7 +10,7 @@
@c in the standalone derivations of this file (e.g. NEWS).
@set copyrights-news 1995,1996,1997,1998,1999,2000,2001,2002
@set last-update-news 2002-11-02
@set last-update-news 2002-11-19
@include root.texi
@ -181,6 +181,8 @@ gave wrong results)
(libf2c) DATE_AND_TIME milliseconds field inactive on Windows
@item 7388
Incorrect output with 0-based array of characters
@item 8587
Double complex zero ** double precision number -> NaN instead of zero
@end table
@item
Richard Henderson (@email{rth@@redhat.com}) analysed and improved the handling

View file

@ -1,3 +1,8 @@
2002-11-19 Toon Moene <toon@moene.indiv.nluug.nl>
PR fortran/8587
* libF77/pow_zz.c: Handle (0.0, 0.0) ** power.
2002-09-23 Zack Weinberg <zack@codesourcery.com>
* libF77/Version.c: Rename junk to __LIBF77_VERSION__. Add

View file

@ -8,6 +8,12 @@ pow_zz (doublecomplex * r, doublecomplex * a, doublecomplex * b)
{
double logr, logi, x, y;
if (a->r == 0.0 && a->i == 0.0)
{
/* Algorithm below doesn't cope. */
r->r = r->i = 0.0;
return;
}
logr = log (f__cabs (a->r, a->i));
logi = atan2 (a->i, a->r);