summaryrefslogtreecommitdiff
path: root/lib/libm/compat/compat_cabs.c
blob: af6c4572908a967381a19f4461c6fe5afea8f9ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * cabs() wrapper for hypot().
 *
 * Written by J.T. Conklin, <jtc@wimsey.com>
 * Placed into the Public Domain, 1994.
 */

#include <sys/cdefs.h>
#if defined(LIBM_SCCS) && !defined(lint)
__RCSID("$NetBSD: compat_cabs.c,v 1.2 2007/08/10 21:20:35 drochner Exp $");
#endif

#include "../src/namespace.h"
#include <math.h>

struct complex {
	double x;
	double y;
};

double cabs(struct complex);
__warn_references(cabs, "warning: reference to compatibility cabs()");

double
cabs(struct complex z)
{

	return hypot(z.x, z.y);
}