diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-01-23 00:08:52 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-01-23 00:08:52 +0000 |
commit | 8d22d7d086ae6cba6f979b89aeb6a9e7e1d5c53c (patch) | |
tree | 62727e15df1573fe0199de985dabdf0c51843dc1 /mpfr-test.h | |
parent | 77185755c80758bf0025ff3fa11f608c33e7c670 (diff) | |
download | mpfr-8d22d7d086ae6cba6f979b89aeb6a9e7e1d5c53c.tar.gz |
MAX, MIN, ABS macros undefined before being redefined.
Fix in ABS macro.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1669 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'mpfr-test.h')
-rw-r--r-- | mpfr-test.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mpfr-test.h b/mpfr-test.h index d92bbeb1a..a436a5fb6 100644 --- a/mpfr-test.h +++ b/mpfr-test.h @@ -37,9 +37,16 @@ double Ulp _PROTO ((double)); #define MINNORM 2.2250738585072013831e-308 /* 2^(-1022), smallest normalized */ #define MAXNORM 1.7976931348623157081e308 /* 2^(1023)*(2-2^(-52)) */ +/* The MAX, MIN and ABS macros may already be defined if gmp-impl.h has + been included. They have the same semantics as in gmp-impl.h, but the + expressions may be slightly different. So, it's better to undefine + them first, as required by the ISO C standard. */ +#undef MAX +#undef MIN +#undef ABS #define MAX(a, b) (((a) > (b)) ? (a) : (b)) #define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#define ABS(x) (((x)>0) ? (x) : (-x)) +#define ABS(x) (((x)>0) ? (x) : -(x)) /* generate a random double using the whole range of possible values, including denormalized numbers, NaN, infinities, ... */ |