cabs.c File Reference

#include "math.h"

Include dependency graph for cabs.c:

Go to the source code of this file.

Functions

double f__cabs (double real, double imag)


Function Documentation

double f__cabs ( double  real,
double  imag 
)

Definition at line 10 of file cabs.c.

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 }


Generated on Sun Mar 4 15:04:07 2007 for Scilab [trunk] by  doxygen 1.5.1