Inequality (*solved*) britlion Posting Freak Posts: 805 Threads: 135 Joined: Apr 2009 Reputation: 5 06-06-2012, 09:24 PM Am I doing something wrong here? I think the order of operations is messing up. This looks very odd. Is BAND a lower priority than = ? Code:```dim n as uInteger cls for n=0 to 65530     print at 10,10;n;"  ";n BAND 7     print at 12,6;"n BAND 7 = 7 is ";     IF n BAND 7 = 7 then         print "TRUE "     else         print "FALSE"     END IF pause 0 next n``` I /think/ this is doing boolean logic of ( n BAND ( 7 = 7 ) ) Or, n BAND 1 Which can't be right, surely? boriel Administrator Posts: 1,690 Threads: 54 Joined: Aug 2019 Reputation: 10 06-06-2012, 10:36 PM Could be a bug, yes. Will check it. If bAND has the same priority as AND then it will proceed as you said. bAND should behave like * operator (multiply), I Think boriel Administrator Posts: 1,690 Threads: 54 Joined: Aug 2019 Reputation: 10 06-11-2012, 07:29 PM Hi, Britlion. In effect, the operators priority was not the standard one. I think this one is the expected one. :?: Code:```('left', 'OR'),     ('left', 'AND'),     ('left', 'XOR'),     ('right', 'NOT'),     ('left', 'LT', 'GT', 'EQ', 'LE', 'GE', 'NE'),     ('left', 'BOR'),     ('left', 'BAND', 'BXOR', 'SHR', 'SHL'),     ('left', 'BNOT', 'PLUS', 'MINUS'),     ('left', 'MOD'),     ('left', 'MUL', 'DIV'),     ('right', 'UMINUS'),     ('right', 'POW')```Note: The "left" and "right" refers to the operator associativity. Less precedence is on top, higher precedence is on the bottom (so POW -> ^ is takes the highest precedence). Also now BOR, BAND and BXOR have higher precedence than =, <>, >=, <= etc... (relational operators, here named EQ, NE, LE, etc...) boriel Administrator Posts: 1,690 Threads: 54 Joined: Aug 2019 Reputation: 10 06-17-2012, 09:10 PM Ok. Please download version 1.2.9s882. It addressed many bugs (this being one of them). Please, try it and tell me. :roll: « Next Oldest | Next Newest »