| 70 | #undef abs |
| 71 | |
| 72 | double f__cabs(double real, double imag) |
| 73 | #endif |
| 74 | { |
| 75 | double temp; |
| 76 | |
| 77 | if(real < 0) |
| 78 | real = -real; |
| 79 | if(imag < 0) |
| 80 | imag = -imag; |
| 81 | if(imag > real){ |
| 82 | temp = real; |
| 83 | real = imag; |
| 84 | imag = temp; |
| 85 | } |
| 86 | if((imag+real) == real) |
| 87 | return((double)real); |
| 88 | |
| 89 | temp = imag/real; |
| 90 | temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/ |
| 91 | return(temp); |
| 92 | } |
| 93 | |
| 94 | VOID |
| 95 | #ifdef KR_headers |