aboutsummaryrefslogtreecommitdiffstats
path: root/main/libc0.9.32/0014-libm-add-cabsf-and-cabsl-functions.patch
blob: cb19a9f954bc4d5e0cf7adb1f862ca145ee1e3d1 (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
30
31
32
33
34
35
36
37
38
39
From aee19ef04c6abf52f4fd646269fcf8a8609164f9 Mon Sep 17 00:00:00 2001
From: William Pitcock <nenolod@dereferenced.org>
Date: Tue, 1 Nov 2011 18:55:25 -0500
Subject: [PATCH] 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>
(cherry picked from commit 2086015b9a223586c1a2b8d7f015ad3a38bdf8bc)
---
 libm/w_cabs.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/libm/w_cabs.c b/libm/w_cabs.c
index 4044f4b..b259248 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
-- 
1.7.8