Checking conditions [IF ... THEN ... ELSE] performance
|
09-15-2015, 05:25 AM
Post: #8
|
|||
|
|||
RE: Checking conditions [IF ... THEN ... ELSE] performance
Hello,
You are correct. All parameters are evaluated FIRST and then the AND operation is 'calculated'. a statement of the form a AND b AND c will be represented as an evaluation tree of the form (in LISP) (AND a, AND(b, c)) It will cause a to be evaluated, then b, then c, then the b AND c will be calculated, and finally the a AND result of AND(b,c)... You can check that by replacing a, b and c by function call that print something on the screen and looking at the print order. This difears from C type programming languages which do have OR/AND operator short circuiting. This feels correct for math operation, but it is true that it is not optimal from a programming performance point of view. Cyrille Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Checking conditions [IF ... THEN ... ELSE] performance - komame - 09-14-2015, 06:24 PM
RE: Checking conditions [IF ... THEN ... ELSE] performance - Joe Horn - 09-14-2015, 07:21 PM
RE: Checking conditions [IF ... THEN ... ELSE] performance - Tim Wessman - 09-14-2015, 07:36 PM
RE: Checking conditions [IF ... THEN ... ELSE] performance - komame - 09-14-2015, 09:01 PM
RE: Checking conditions [IF ... THEN ... ELSE] performance - primer - 09-14-2015, 09:24 PM
RE: Checking conditions [IF ... THEN ... ELSE] performance - Joe Horn - 09-15-2015, 05:04 AM
RE: Checking conditions [IF ... THEN ... ELSE] performance - roadrunner - 09-14-2015, 10:06 PM
RE: Checking conditions [IF ... THEN ... ELSE] performance - cyrille de brébisson - 09-15-2015 05:25 AM
RE: Checking conditions [IF ... THEN ... ELSE] performance - StephenG1CMZ - 09-15-2015, 09:42 AM
|
User(s) browsing this thread: 2 Guest(s)