diff options
| author | drochner <drochner@NetBSD.org> | 2007-02-06 17:29:37 +0000 |
|---|---|---|
| committer | drochner <drochner@NetBSD.org> | 2007-02-06 17:29:37 +0000 |
| commit | a981c4eb78d246da3a084647da8ac2741f8ebb96 (patch) | |
| tree | 90d7073e2f7f798811d04b4a99c501db297a77e9 /include/math.h | |
| parent | e8146d3cc6dee652ed6c78d4749a4b9e9adbac5f (diff) | |
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
Diffstat (limited to 'include/math.h')
| -rw-r--r-- | include/math.h | 13 |
1 files changed, 11 insertions, 2 deletions
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 && ... */ |
