OSDN Git Service

2005-06-12 Steven G. Kargl <kargls@comcast.net>
[pf3gnuchains/gcc-fork.git] / libgfortran / generated / exp_c4.c
index d952134..c4bc41b 100644 (file)
@@ -2,20 +2,29 @@
    Copyright 2002, 2004 Free Software Foundation, Inc.
    Contributed by Paul Brook <paul@nowt.org>
 
-This file is part of the GNU Fortran 95 runtime library (libgfor).
+This file is part of the GNU Fortran 95 runtime library (libgfortran).
 
 Libgfortran is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
+modify it under the terms of the GNU General Public
 License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
+version 2 of the License, or (at your option) any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file.  (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
 
 Libgfortran is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU Lesser General Public License for more details.
+GNU General Public License for more details.
 
-You should have received a copy of the GNU Lesser General Public
-License along with libgfor; see the file COPYING.LIB.  If not,
+You should have received a copy of the GNU General Public
+License along with libgfortran; see the file COPYING.  If not,
 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 #include <math.h>
@@ -30,17 +39,14 @@ cabsf (GFC_COMPLEX_4 z)
   return hypotf (REALPART (z), IMAGPART (z));
 }
 
-/* Complex argument.  The angle made with the +ve real axis.  Range 0-2pi.  */
+/* Complex argument.  The angle made with the +ve real axis.
+   Range -pi-pi.  */
 GFC_REAL_4
 cargf (GFC_COMPLEX_4 z)
 {
   GFC_REAL_4 arg;
 
-  arg = atan2f (IMAGPART (z), REALPART (z));
-  if (arg < 0)
-    return arg + 2 * M_PI;
-  else
-    return arg;
+  return atan2f (IMAGPART (z), REALPART (z));
 }
 
 /* exp(z) = exp(a)*(cos(b) + isin(b))  */
@@ -102,7 +108,7 @@ csqrtf (GFC_COMPLEX_4 z)
         }
       else
         {
-          COMPLEX_ASSIGN (v, fabsf (sqrt (re)),
+          COMPLEX_ASSIGN (v, fabsf (sqrtf (re)),
                           copysignf (0.0, im));
         }
     }
@@ -110,7 +116,7 @@ csqrtf (GFC_COMPLEX_4 z)
     {
       GFC_REAL_4 r;
 
-      r = sqrtf (0.5 * fabs (im));
+      r = sqrtf (0.5 * fabsf (im));
 
       COMPLEX_ASSIGN (v, copysignf (r, im), r);
     }