1: /*
   2:  *	"@(#)cabs.c	1.1"
   3:  */
   4: 
   5: double cabs(real, imag)
   6: double real, imag;
   7: {
   8: double temp, sqrt();
   9: 
  10: if(real < 0)
  11:     real = -real;
  12: if(imag < 0)
  13:     imag = -imag;
  14: if(imag > real){
  15:     temp = real;
  16:     real = imag;
  17:     imag = temp;
  18: }
  19: if((real+imag) == real)
  20:     return(real);
  21: 
  22: temp = imag/real;
  23: temp = real*sqrt(1.0 + temp*temp);  /*overflow!!*/
  24: return(temp);
  25: }

Defined functions

Last modified: 1983-05-20
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 598
Valid CSS Valid XHTML 1.0 Strict