]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/8587 ((double complex zero)**(double prec number) = NAN instead of...
authorToon Moene <toon@moene.indiv.nluug.nl>
Tue, 19 Nov 2002 23:17:36 +0000 (00:17 +0100)
committerToon Moene <toon@gcc.gnu.org>
Tue, 19 Nov 2002 23:17:36 +0000 (23:17 +0000)
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

gcc/f/ChangeLog
gcc/f/news.texi
libf2c/ChangeLog
libf2c/libF77/pow_zz.c

index 4960f2f278d53917f276fe5f8daeb503b940ef99..2142b4c0d164857efd7d14cfd0ae2db279407ff3 100644 (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.
index 24cec0aded50c0a1f0d34ca3e7b5ce729b9845ef..2d0dc0f49ef652916607d11e7a5f9245af784f29 100644 (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
index e06717f03bdf75b703d5808b92117db765977460..7e10295040d847eddf4d2fb85195527e843c35a2 100644 (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
index 522b639bc7e885e1cee128c642ed054d593676da..d5cfbf3d9316dce6358a846894257fabf5f23f69 100644 (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);