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