The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inequality (*solved*)
#3
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...)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)