Doxygen Source Code Documentation
c_abs.c File Reference
#include "f2c.h"Go to the source code of this file.
Functions | |
| double | f__cabs (double, double) |
| double | c_abs (complex *z) |
Function Documentation
|
|
Definition at line 10 of file c_abs.c. References f__cabs().
|
|
||||||||||||
|
Definition at line 7 of file cabs.c.
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); /*overflow!!*/
00026 return(temp);
00027 }
|