Commit 27dcc451 by Toon Moene Committed by Toon Moene

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
parent efcc7037
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> 2002-11-19 Jason Thorpe <thorpej@wasabisystems.com>
* g77spec.c (lang_specific_spec_functions): New. * g77spec.c (lang_specific_spec_functions): New.
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
@c in the standalone derivations of this file (e.g. NEWS). @c in the standalone derivations of this file (e.g. NEWS).
@set copyrights-news 1995,1996,1997,1998,1999,2000,2001,2002 @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 @include root.texi
...@@ -181,6 +181,8 @@ gave wrong results) ...@@ -181,6 +181,8 @@ gave wrong results)
(libf2c) DATE_AND_TIME milliseconds field inactive on Windows (libf2c) DATE_AND_TIME milliseconds field inactive on Windows
@item 7388 @item 7388
Incorrect output with 0-based array of characters Incorrect output with 0-based array of characters
@item 8587
Double complex zero ** double precision number -> NaN instead of zero
@end table @end table
@item @item
Richard Henderson (@email{rth@@redhat.com}) analysed and improved the handling Richard Henderson (@email{rth@@redhat.com}) analysed and improved the handling
......
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> 2002-09-23 Zack Weinberg <zack@codesourcery.com>
* libF77/Version.c: Rename junk to __LIBF77_VERSION__. Add * libF77/Version.c: Rename junk to __LIBF77_VERSION__. Add
......
...@@ -8,6 +8,12 @@ pow_zz (doublecomplex * r, doublecomplex * a, doublecomplex * b) ...@@ -8,6 +8,12 @@ pow_zz (doublecomplex * r, doublecomplex * a, doublecomplex * b)
{ {
double logr, logi, x, y; 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)); logr = log (f__cabs (a->r, a->i));
logi = atan2 (a->i, a->r); logi = atan2 (a->i, a->r);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment