From a981c4eb78d246da3a084647da8ac2741f8ebb96 Mon Sep 17 00:00:00 2001 From: drochner Date: Tue, 6 Feb 2007 17:29:37 +0000 Subject: add the isgreater() at al. comparision macros defined in C99 and SUSv3; use just the primitive macros for now (identical to FreeBSD/DragonFly) which don't use gcc internals, the rest can go in after some testing; addresses PR standards/25520 --- include/math.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'include/math.h') diff --git a/include/math.h b/include/math.h index b200e37444f..7be92550f29 100644 --- a/include/math.h +++ b/include/math.h @@ -1,4 +1,4 @@ -/* $NetBSD: math.h,v 1.44 2006/03/25 16:41:11 xtraeme Exp $ */ +/* $NetBSD: math.h,v 1.45 2007/02/06 17:29:37 drochner Exp $ */ /* * ==================================================== @@ -331,7 +331,7 @@ long long int llroundf(float); float fmodf(float, float); float remainderf(float, float); -/* 7.2.11 manipulation */ +/* 7.12.11 manipulation */ float copysignf(float, float); double nan(const char *); @@ -339,6 +339,15 @@ float nanf(const char *); long double nanl(const char *); float nextafterf(float, float); +/* 7.12.14 comparision */ + +#define isunordered(x, y) (isnan(x) || isnan(y)) +#define isgreater(x, y) (!isunordered((x), (y)) && (x) > (y)) +#define isgreaterequal(x, y) (!isunordered((x), (y)) && (x) >= (y)) +#define isless(x, y) (!isunordered((x), (y)) && (x) < (y)) +#define islessequal(x, y) (!isunordered((x), (y)) && (x) <= (y)) +#define islessgreater(x, y) (!isunordered((x), (y)) && \ + ((x) > (y) || (y) > (x))) #endif /* !_ANSI_SOURCE && ... */ -- cgit