summaryrefslogtreecommitdiffstats
path: root/lib/libm/src/s_nan.c
diff options
context:
space:
mode:
authormartynas <martynas@openbsd.org>2008-12-09 20:00:35 +0000
committermartynas <martynas@openbsd.org>2008-12-09 20:00:35 +0000
commit390c8400525fc0ecc9e2c49c2246076b1b49fe19 (patch)
tree53eacecd5d140dfe4af32e85cbd374f340c935fc /lib/libm/src/s_nan.c
parent- add long double signbit (diff)
downloadwireguard-openbsd-390c8400525fc0ecc9e2c49c2246076b1b49fe19.tar.xz
wireguard-openbsd-390c8400525fc0ecc9e2c49c2246076b1b49fe19.zip
- 80-bit and quad precision trigonometric and other most
important functions: acosl, asinl, atanl, atan2l, cosl, sinl, tanl, exp2l, frexpl, ilogbl, ldexpl, logbl, scalbnl, fabsl, hypotl, powl, sqrtl, rintl, copysignl, nanl, fdiml, fmaxl, fminl. mostly taken from freebsd, needed alot of changes to adapt. note, these are all c versions; and are quite slow when architectures have, e.g. sqrt. assembly versions will be added afterwards - make them .weak/__weak_alias to the double precision versions on other archs - no need to have two finites. finite() and finitef() are non-standard 3BSD obsolete versions of isfinite. remove from libm. make them weak_alias in libc to __isfinite and __isfinitef instead. similarly make 3BSD obsolete versions of isinf, isinff, isnan, isnanf weak_aliases to C99's __isinf, __isinff, __isnan, __isnanf - remove unused infinity.c. the c library has infinities for each supported platform - use STRICT_ASSIGN cast hack for _kernel_rem_pio2, so that the double version has a chance of working on i386 with extra precision - avoid storing multiple copies of the pi/2 array, since it won't vary - bump major due to removed finite/finitef. although they will be in libc, which anything is linked to, minor bump might be enough ok millert@. tested by sthen@, jsg@, ajacoutot@, kili@, naddy@
Diffstat (limited to 'lib/libm/src/s_nan.c')
-rw-r--r--lib/libm/src/s_nan.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libm/src/s_nan.c b/lib/libm/src/s_nan.c
index 3e99cfda129..99b55590313 100644
--- a/lib/libm/src/s_nan.c
+++ b/lib/libm/src/s_nan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_nan.c,v 1.4 2008/09/07 20:36:09 martynas Exp $ */
+/* $OpenBSD: s_nan.c,v 1.5 2008/12/09 20:00:35 martynas Exp $ */
/*-
* Copyright (c) 2007 David Schultz
* All rights reserved.
@@ -27,6 +27,7 @@
* $FreeBSD: src/lib/msun/src/s_nan.c,v 1.2 2007/12/18 23:46:32 das Exp $
*/
+#include <machine/cdefs.h>
#include <sys/types.h>
#include <sys/endian.h>
#include <ctype.h>
@@ -121,3 +122,9 @@ nanf(const char *s)
u.bits[0] |= 0x7fc00000;
return (u.f);
}
+
+#if LDBL_MANT_DIG == 53
+#ifdef __weak_alias
+__weak_alias(nanl, nan);
+#endif /* __weak_alias */
+#endif /* LDBL_MANT_DIG == 53 */