summaryrefslogtreecommitdiffstats
path: root/lib/libm/src
diff options
context:
space:
mode:
authorshadchin <shadchin@openbsd.org>2015-12-18 12:17:44 +0000
committershadchin <shadchin@openbsd.org>2015-12-18 12:17:44 +0000
commit7b2dca51032183f5ea72ef3960d9c6324d5c96c2 (patch)
treecbbf67b171e2c96e72b611edf949a503ddc53519 /lib/libm/src
parentFix behavior csqrt, should be (diff)
downloadwireguard-openbsd-7b2dca51032183f5ea72ef3960d9c6324d5c96c2.tar.xz
wireguard-openbsd-7b2dca51032183f5ea72ef3960d9c6324d5c96c2.zip
Fix wrong answer if the imaginary part is zero.
NetBSD also turn off this piece of code. ok tb@
Diffstat (limited to 'lib/libm/src')
-rw-r--r--lib/libm/src/s_casin.c4
-rw-r--r--lib/libm/src/s_casinf.c4
-rw-r--r--lib/libm/src/s_casinl.c4
3 files changed, 9 insertions, 3 deletions
diff --git a/lib/libm/src/s_casin.c b/lib/libm/src/s_casin.c
index e615f764b1f..83e97ae9e22 100644
--- a/lib/libm/src/s_casin.c
+++ b/lib/libm/src/s_casin.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_casin.c,v 1.6 2013/07/03 04:46:36 espie Exp $ */
+/* $OpenBSD: s_casin.c,v 1.7 2015/12/18 12:17:44 shadchin Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
*
@@ -63,6 +63,7 @@ casin(double complex z)
x = creal (z);
y = cimag (z);
+#if 0
if (y == 0.0) {
if (fabs(x) > 1.0) {
w = M_PI_2 + 0.0 * I;
@@ -73,6 +74,7 @@ casin(double complex z)
}
return (w);
}
+#endif
/* Power series expansion */
/*
diff --git a/lib/libm/src/s_casinf.c b/lib/libm/src/s_casinf.c
index 39cbb48017e..6edbfbf16d5 100644
--- a/lib/libm/src/s_casinf.c
+++ b/lib/libm/src/s_casinf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_casinf.c,v 1.3 2011/07/20 19:28:33 martynas Exp $ */
+/* $OpenBSD: s_casinf.c,v 1.4 2015/12/18 12:17:44 shadchin Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
*
@@ -65,6 +65,7 @@ casinf(float complex z)
x = crealf(z);
y = cimagf(z);
+#if 0
if(y == 0.0f) {
if(fabsf(x) > 1.0f) {
w = (float)M_PI_2 + 0.0f * I;
@@ -75,6 +76,7 @@ casinf(float complex z)
}
return (w);
}
+#endif
/* Power series expansion */
/*
diff --git a/lib/libm/src/s_casinl.c b/lib/libm/src/s_casinl.c
index 64e366b34ec..0411be142c0 100644
--- a/lib/libm/src/s_casinl.c
+++ b/lib/libm/src/s_casinl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_casinl.c,v 1.3 2011/07/20 21:02:51 martynas Exp $ */
+/* $OpenBSD: s_casinl.c,v 1.4 2015/12/18 12:17:44 shadchin Exp $ */
/*
* Copyright (c) 2008 Stephen L. Moshier <steve@moshier.net>
@@ -71,6 +71,7 @@ casinl(long double complex z)
x = creall(z);
y = cimagl(z);
+#if 0
if (y == 0.0L) {
if (fabsl(x) > 1.0L) {
w = PIO2L + 0.0L * I;
@@ -81,6 +82,7 @@ casinl(long double complex z)
}
return (w);
}
+#endif
/* Power series expansion */
b = cabsl(z);