summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2009-03-28 16:16:31 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2009-03-28 16:16:31 +0000
commit37fdb79f001cf5c845b5a41606fed69239850cb4 (patch)
tree8c3165d296aff51c3f50e1d0c09d1c5b92dc4d06
parentaa64f85d6421fd8a6ca8e665901a12cac2ef7154 (diff)
add C99-conformant nan, nanf, nanl for vax. always return zero,
since its fp does not have distinguished values for qnans. tested by naddy@; fixes libnova. ok theo
-rw-r--r--lib/libm/Makefile4
-rw-r--r--lib/libm/noieee_src/n_nan.c29
2 files changed, 31 insertions, 2 deletions
diff --git a/lib/libm/Makefile b/lib/libm/Makefile
index 375eed02165..5912a8291bf 100644
--- a/lib/libm/Makefile
+++ b/lib/libm/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.62 2008/12/12 19:30:17 martynas Exp $
+# $OpenBSD: Makefile,v 1.63 2009/03/28 16:16:30 martynas Exp $
# $NetBSD: Makefile,v 1.28 1995/11/20 22:06:19 jtc Exp $
#
# @(#)Makefile 5.1beta 93/09/24
@@ -117,7 +117,7 @@ NOIEEE_SRCS = n_acosh.c n_argred.c n_asincos.c n_asinh.c n_atan.c \
n_erf.c n_exp.c n_exp__E.c n_expm1.c n_fdim.c n_floor.c \
n_fmax.c n_fmaxf.c n_fmin.c n_fminf.c n_fmod.c n_hypot.c \
n_infnan.c n_j0.c n_j1.c n_jn.c n_lgamma.c n_log.c n_log10.c \
- n_log1p.c n_log__L.c n_pow.c n_round.c n_sincos.c n_sinh.c \
+ n_log1p.c n_log__L.c n_nan.c n_pow.c n_round.c n_sincos.c n_sinh.c \
n_sqrt.c n_support.c n_tan.c n_tanh.c n_tgamma.c
# OpenBSD's C library supplies these functions:
diff --git a/lib/libm/noieee_src/n_nan.c b/lib/libm/noieee_src/n_nan.c
new file mode 100644
index 00000000000..3b0cb57a4ba
--- /dev/null
+++ b/lib/libm/noieee_src/n_nan.c
@@ -0,0 +1,29 @@
+/* $OpenBSD: n_nan.c,v 1.1 2009/03/28 16:16:30 martynas Exp $ */
+
+/*
+ * Written by Martynas Venckus. Public domain
+ */
+
+#include <math.h>
+
+/* ARGSUSED */
+double
+nan(const char *tagp)
+{
+ return (0);
+}
+
+/* ARGSUSED */
+float
+nanf(const char *tagp)
+{
+ return (0);
+}
+
+/* ARGSUSED */
+long double
+nanl(const char *tagp)
+{
+ return (0);
+}
+