blob: 49864619b07262f2a5a42f1cfe36455ec7e0d7bf [file] [log] [blame]
Elliott Hughesa0ee0782013-01-30 19:06:37 -08001/*
2 * cabs() wrapper for hypot().
3 *
4 * Written by J.T. Conklin, <jtc@wimsey.com>
5 * Placed into the Public Domain, 1994.
6 */
7
Elliott Hughesa0ee0782013-01-30 19:06:37 -08008#include <complex.h>
9#include <float.h>
10#include <math.h>
11
12double
13cabs(double complex z)
14{
15 return hypot(creal(z), cimag(z));
16}
17
18#if LDBL_MANT_DIG == 53
19__weak_reference(cabs, cabsl);
20#endif