From c2b5e6cf434dac91772ab814fa8c408d50417175 Mon Sep 17 00:00:00 2001 From: schnetter Date: Fri, 7 Nov 2003 14:53:08 +0000 Subject: Allow comparison operators in accumulator expressions. Add the ! not operator to accumulator expressions. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3454 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/util/Expression.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/util/Expression.c') diff --git a/src/util/Expression.c b/src/util/Expression.c index 9b6156ef..a9728878 100644 --- a/src/util/Expression.c +++ b/src/util/Expression.c @@ -109,6 +109,7 @@ static struct {"*", binary, 4,OP_TIMES}, {"^", binary, 5,OP_POWER}, /* Unary Operators - these must have the highest precedence. */ + {"!", unary, 6, OP_NOT}, {"acos", unary, 6, OP_ACOS}, {"asin", unary, 6, OP_ASIN}, {"atan", unary, 6, OP_ATAN}, @@ -998,6 +999,9 @@ static int EvaluateUnary(uExpressionValue *retval, #define EVALUATEUNARY(retval, val) \ switch(opcode) \ { \ + case OP_NOT : \ + (retval) = !(val); \ + break; \ case OP_ACOS : \ (retval) = acos(val); \ break; \ -- cgit v1.2.3