Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
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 "mathh.h"
00007 double f__cabs(double real, double imag)
00008 #endif
00009 {
00010 double temp;
00011
00012 if(real < 0)
00013 real = -real;
00014 if(imag < 0)
00015 imag = -imag;
00016 if(imag > real){
00017 temp = real;
00018 real = imag;
00019 imag = temp;
00020 }
00021 if((real+imag) == real)
00022 return(real);
00023
00024 temp = imag/real;
00025 temp = real*sqrt(1.0 + temp*temp);
00026 return(temp);
00027 }