1 /* 2 * cabs() wrapper for hypot(). 3 * 4 * Written by J.T. Conklin, <jtc (at) wimsey.com> 5 * Placed into the Public Domain, 1994. 6 */ 7 8 #include <sys/cdefs.h> 9 #if defined(LIBM_SCCS) && !defined(lint) 10 __RCSID("$NetBSD: compat_cabs.c,v 1.1 2007/02/22 22:08:19 drochner Exp $"); 11 #endif 12 13 #include <math.h> 14 15 struct complex { 16 double x; 17 double y; 18 }; 19 20 double cabs(struct complex); 21 __warn_references(cabs, "warning: reference to compatibility cabs()"); 22 23 double 24 cabs(struct complex z) 25 { 26 27 return hypot(z.x, z.y); 28 } 29