From 37fdb79f001cf5c845b5a41606fed69239850cb4 Mon Sep 17 00:00:00 2001 From: Martynas Venckus Date: Sat, 28 Mar 2009 16:16:31 +0000 Subject: 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 --- lib/libm/Makefile | 4 ++-- lib/libm/noieee_src/n_nan.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 lib/libm/noieee_src/n_nan.c (limited to 'lib') 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 + +/* 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); +} + -- cgit v1.2.3