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