aboutsummaryrefslogtreecommitdiff
path: root/libf2c/libF77
diff options
context:
space:
mode:
authorToon Moene <toon@moene.indiv.nluug.nl>2002-11-20 00:17:36 +0100
committerToon Moene <toon@gcc.gnu.org>2002-11-19 23:17:36 +0000
commit27dcc451f40505497c3c7788dfd935d4afa897cb (patch)
tree3b88d6d3847d7785e7d7a32ceaeb9108cdb7125a /libf2c/libF77
parentefcc70370b9319ec419e220cece0e8c82642c298 (diff)
downloadgcc-27dcc451f40505497c3c7788dfd935d4afa897cb.zip
gcc-27dcc451f40505497c3c7788dfd935d4afa897cb.tar.gz
gcc-27dcc451f40505497c3c7788dfd935d4afa897cb.tar.bz2
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
Diffstat (limited to 'libf2c/libF77')
-rw-r--r--libf2c/libF77/pow_zz.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libf2c/libF77/pow_zz.c b/libf2c/libF77/pow_zz.c
index 522b639..d5cfbf3 100644
--- a/libf2c/libF77/pow_zz.c
+++ b/libf2c/libF77/pow_zz.c
@@ -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);