OSDN Git Service

* libF77/*: Delete KR_headers cruft.
[pf3gnuchains/gcc-fork.git] / libf2c / libF77 / cabs.c
1 #undef abs
2 #include <math.h>
3 double f__cabs(double real, double imag)
4 {
5 double temp;
6
7 if(real < 0)
8         real = -real;
9 if(imag < 0)
10         imag = -imag;
11 if(imag > real){
12         temp = real;
13         real = imag;
14         imag = temp;
15 }
16 if((real+imag) == real)
17         return(real);
18
19 temp = imag/real;
20 temp = real*sqrt(1.0 + temp*temp);  /*overflow!!*/
21 return(temp);
22 }