w_cabs.c revision 2116
12116Sjkh/* 22116Sjkh * cabs() wrapper for hypot(). 32116Sjkh * 42116Sjkh * Written by J.T. Conklin, <jtc@wimsey.com> 52116Sjkh * Placed into the Public Domain, 1994. 62116Sjkh */ 72116Sjkh 82116Sjkh#include <math.h> 92116Sjkh 102116Sjkhstruct complex { 112116Sjkh double x; 122116Sjkh double y; 132116Sjkh}; 142116Sjkh 152116Sjkhdouble 162116Sjkhcabs(z) 172116Sjkh struct complex z; 182116Sjkh{ 192116Sjkh return hypot(z.x, z.y); 202116Sjkh} 21