order of logical operations in CAS
|
10-14-2022, 03:40 AM
(This post was last modified: 10-14-2022 03:41 AM by Wes Loewer.)
Post: #1
|
|||
|
|||
order of logical operations in CAS
I noticed that in Home A OR B AND C is treated as A OR (B AND C) as expected with AND having a higher precedence than OR.
However, in CAS a OR b AND c is treated as (a OR b) AND c, evaluating left to right with AND and OR having the same precedence. For example: Home: true OR false AND false --> 1 CAS (and XCAS) true OR false AND false --> false Is this a bug, or is this the intended behavior? |
|||
10-14-2022, 06:18 AM
Post: #2
|
|||
|
|||
RE: order of logical operations in CAS
Indeed, and and or have the same precedence in CAS because they are parsed with the same parser token in input_parser.yy (%left T_AND_OP), cf. input_lexer.ll
Code:
|
|||
10-14-2022, 01:36 PM
Post: #3
|
|||
|
|||
RE: order of logical operations in CAS | |||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)