xref: /haiku/src/system/libroot/posix/glibc/math/cabs.c (revision f504f61099b010fbfa94b1cc63d2e9072c7f7185)
1a8344698SJérôme Duval /* Return the complex absolute value of double complex value.
2a8344698SJérôme Duval    Copyright (C) 1997-2015 Free Software Foundation, Inc.
3a8344698SJérôme Duval    This file is part of the GNU C Library.
4a8344698SJérôme Duval    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
5a8344698SJérôme Duval 
6a8344698SJérôme Duval    The GNU C Library is free software; you can redistribute it and/or
7a8344698SJérôme Duval    modify it under the terms of the GNU Lesser General Public
8a8344698SJérôme Duval    License as published by the Free Software Foundation; either
9a8344698SJérôme Duval    version 2.1 of the License, or (at your option) any later version.
10a8344698SJérôme Duval 
11a8344698SJérôme Duval    The GNU C Library is distributed in the hope that it will be useful,
12a8344698SJérôme Duval    but WITHOUT ANY WARRANTY; without even the implied warranty of
13a8344698SJérôme Duval    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14a8344698SJérôme Duval    Lesser General Public License for more details.
15a8344698SJérôme Duval 
16a8344698SJérôme Duval    You should have received a copy of the GNU Lesser General Public
17a8344698SJérôme Duval    License along with the GNU C Library; if not, see
18a8344698SJérôme Duval    <http://www.gnu.org/licenses/>.  */
19a8344698SJérôme Duval 
20a8344698SJérôme Duval #include <complex.h>
21a8344698SJérôme Duval #include <math.h>
22a8344698SJérôme Duval 
23a8344698SJérôme Duval double
__cabs(double _Complex z)24a8344698SJérôme Duval __cabs (double _Complex z)
25a8344698SJérôme Duval {
26*f504f610SAugustin Cavalier   return hypot (__real__ z, __imag__ z);
27a8344698SJérôme Duval }
28a8344698SJérôme Duval weak_alias (__cabs, cabs)
29a8344698SJérôme Duval #ifdef NO_LONG_DOUBLE
30a8344698SJérôme Duval strong_alias (__cabs, __cabsl)
31a8344698SJérôme Duval weak_alias (__cabs, cabsl)
32a8344698SJérôme Duval #endif
33