summaryrefslogtreecommitdiff
path: root/libm
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2011-11-01 18:55:25 -0500
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2011-11-04 10:25:21 +0100
commit2086015b9a223586c1a2b8d7f015ad3a38bdf8bc (patch)
tree22ff4f92758e057b4fa1825411a76c05740799a8 /libm
parent6471fc450b66dcb1ba16fe6568cd52221ca64cd1 (diff)
libm: add cabsf() and cabsl() functions.
Signed-off-by: William Pitcock <nenolod@dereferenced.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libm')
-rw-r--r--libm/w_cabs.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libm/w_cabs.c b/libm/w_cabs.c
index 4044f4bff..b2592484c 100644
--- a/libm/w_cabs.c
+++ b/libm/w_cabs.c
@@ -13,3 +13,19 @@ double cabs(double _Complex z)
return hypot(__real__ z, __imag__ z);
}
libm_hidden_def(cabs)
+
+libm_hidden_proto(cabsf)
+float cabsf(float _Complex z)
+{
+ return (float) hypot(__real__ z, __imag__ z);
+}
+libm_hidden_def(cabsf)
+
+#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __NO_LONG_DOUBLE_MATH
+libm_hidden_proto(cabsl)
+long double cabsl(long double _Complex z)
+{
+ return hypotl(__real__ z, __imag__ z);
+}
+libm_hidden_def(cabsl)
+#endif