summaryrefslogtreecommitdiffstats
path: root/lib/msun/src/w_cabsf.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-06-13 15:16:30 +0000
committerru <ru@FreeBSD.org>2001-06-13 15:16:30 +0000
commit0d5bbb03497fb236d7d90377834431974b0614da (patch)
tree37b7552d4bd478688101be23177232d72f8186b9 /lib/msun/src/w_cabsf.c
parent086630c576392797f494de067ba6ca5608875b1a (diff)
downloadFreeBSD-src-0d5bbb03497fb236d7d90377834431974b0614da.zip
FreeBSD-src-0d5bbb03497fb236d7d90377834431974b0614da.tar.gz
Added skeleton <complex.h> (aligned with the POSIX.1-200x), mostly
to fix the "-nostdinc WARNS=X" breakage caused by broken prototypes for cabs() and cabsl() in <math.h>. Reimplemented cabs() and cabsl() using new complex numbers types and moved prototypes from <math.h> to <complex.h>.
Diffstat (limited to 'lib/msun/src/w_cabsf.c')
-rw-r--r--lib/msun/src/w_cabsf.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/msun/src/w_cabsf.c b/lib/msun/src/w_cabsf.c
index 6336d6d..e7bfe22 100644
--- a/lib/msun/src/w_cabsf.c
+++ b/lib/msun/src/w_cabsf.c
@@ -5,17 +5,19 @@
* Placed into the Public Domain, 1994.
*/
-#include "math.h"
-#include "math_private.h"
+#ifndef lint
+static const char rcsid[] =
+ "$FreeBSD$";
+#endif /* not lint */
-struct complex {
- float x;
- float y;
-};
+#include <complex.h>
+#include <math.h>
+#include "math_private.h"
float
cabsf(z)
- struct complex z;
+ float complex z;
{
- return hypotf(z.x, z.y);
+
+ return hypotf(crealf(z), cimagf(z));
}
OpenPOWER on IntegriCloud