summaryrefslogtreecommitdiffstats
path: root/contrib/libf2c/libF77/cabs.c
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2003-07-11 03:42:19 +0000
committerkan <kan@FreeBSD.org>2003-07-11 03:42:19 +0000
commit7b704871fdac058719f34a1e6b9de71ee76c5be4 (patch)
treeddafd6196c36e6100eb4f969af01a11ee9c83a81 /contrib/libf2c/libF77/cabs.c
parentbb754981e6f83bc1f224dc4b7f478d80024e6c9f (diff)
downloadFreeBSD-src-7b704871fdac058719f34a1e6b9de71ee76c5be4.zip
FreeBSD-src-7b704871fdac058719f34a1e6b9de71ee76c5be4.tar.gz
Gcc 3.3.1-pre 2003-07-11 libf2c bits.
Diffstat (limited to 'contrib/libf2c/libF77/cabs.c')
-rw-r--r--contrib/libf2c/libF77/cabs.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/contrib/libf2c/libF77/cabs.c b/contrib/libf2c/libF77/cabs.c
index 2fad044..5d2142e 100644
--- a/contrib/libf2c/libF77/cabs.c
+++ b/contrib/libf2c/libF77/cabs.c
@@ -1,27 +1,24 @@
-#ifdef KR_headers
-extern double sqrt();
-double f__cabs(real, imag) double real, imag;
-#else
#undef abs
#include <math.h>
-double f__cabs(double real, double imag)
-#endif
+double
+f__cabs (double real, double imag)
{
-double temp;
+ double temp;
-if(real < 0)
- real = -real;
-if(imag < 0)
- imag = -imag;
-if(imag > real){
- temp = real;
- real = imag;
- imag = temp;
-}
-if((real+imag) == real)
- return(real);
+ if (real < 0)
+ real = -real;
+ if (imag < 0)
+ imag = -imag;
+ if (imag > real)
+ {
+ temp = real;
+ real = imag;
+ imag = temp;
+ }
+ if ((real + imag) == real)
+ return (real);
-temp = imag/real;
-temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/
-return(temp);
+ temp = imag / real;
+ temp = real * sqrt (1.0 + temp * temp); /*overflow!! */
+ return (temp);
}
OpenPOWER on IntegriCloud