home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / complex-lib / cxampl.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-07-14  |  278 b   |  21 lines

  1. /*
  2.     CxAmpl -- amplitude (magnitude, modulus, norm) of a complex
  3.  
  4.     CxAmpl( &c )    returns  |c|
  5.  
  6.     last edit:    86/01/04    D A Gwyn
  7.  
  8.     SCCS ID:    @(#)cxampl.c    1.1
  9. */
  10.  
  11. #include    <math.h>
  12.  
  13. #include    <complex.h>
  14.  
  15. double
  16. CxAmpl( cp )
  17.     register complex    *cp;
  18.     {
  19.     return hypot( cp->re, cp->im );
  20.     }
  21.