cabs.c
Go to the documentation of this file.
00001 #ifdef KR_headers
00002 extern double sqrt();
00003 double f__cabs(real, imag) double real, imag;
00004 #else
00005 #undef abs
00006 #include "math.h"
00007 #ifdef __cplusplus
00008 extern "C" {
00009 #endif
00010 double f__cabs(double real, double imag)
00011 #endif
00012 {
00013 double temp;
00014 
00015 if(real < 0)
00016         real = -real;
00017 if(imag < 0)
00018         imag = -imag;
00019 if(imag > real){
00020         temp = real;
00021         real = imag;
00022         imag = temp;
00023 }
00024 if((real+imag) == real)
00025         return(real);
00026 
00027 temp = imag/real;
00028 temp = real*sqrt(1.0 + temp*temp);  /*overflow!!*/
00029 return(temp);
00030 }
00031 #ifdef __cplusplus
00032 }
00033 #endif


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:15