Jelajahi Sumber

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>
William Pitcock 13 tahun lalu
induk
melakukan
2086015b9a
1 mengubah file dengan 16 tambahan dan 0 penghapusan
  1. 16 0
      libm/w_cabs.c

+ 16 - 0
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