From e1f1df9c743af60c0e6271fcd78b59dbfd72d8ad Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 27 Sep 2013 13:55:29 +0000 Subject: [PATCH] math: fix comparision macros (isless etc) when FLT_EVAL_METHOD!=0 This is a change in ISO C11 annex F (F.10.11p1), comparision macros can't round their arguments to their semantic type when the evaluation format has wider range and precision. (ie. they must be consistent with the builtin relational operators) --- include/math.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/math.h b/include/math.h index c029156a..dc176012 100644 --- a/include/math.h +++ b/include/math.h @@ -91,20 +91,20 @@ int __signbitl(long double); static __inline int __is##rel(type __x, type __y) \ { return !isunordered(__x,__y) && __x op __y; } -__ISREL_DEF(lessf, <, float) -__ISREL_DEF(less, <, double) +__ISREL_DEF(lessf, <, float_t) +__ISREL_DEF(less, <, double_t) __ISREL_DEF(lessl, <, long double) -__ISREL_DEF(lessequalf, <=, float) -__ISREL_DEF(lessequal, <=, double) +__ISREL_DEF(lessequalf, <=, float_t) +__ISREL_DEF(lessequal, <=, double_t) __ISREL_DEF(lessequall, <=, long double) -__ISREL_DEF(lessgreaterf, !=, float) -__ISREL_DEF(lessgreater, !=, double) +__ISREL_DEF(lessgreaterf, !=, float_t) +__ISREL_DEF(lessgreater, !=, double_t) __ISREL_DEF(lessgreaterl, !=, long double) -__ISREL_DEF(greaterf, >, float) -__ISREL_DEF(greater, >, double) +__ISREL_DEF(greaterf, >, float_t) +__ISREL_DEF(greater, >, double_t) __ISREL_DEF(greaterl, >, long double) -__ISREL_DEF(greaterequalf, >=, float) -__ISREL_DEF(greaterequal, >=, double) +__ISREL_DEF(greaterequalf, >=, float_t) +__ISREL_DEF(greaterequal, >=, double_t) __ISREL_DEF(greaterequall, >=, long double) #define __tg_pred_2(x, y, p) ( \