View Single Post
Amboss's Avatar
Posts: 237 | Thanked: 502 times | Joined on May 2010 @ Mittelfranken, Germany
#50
Originally Posted by reinob View Post
Don't they teach math at school anymore?
Repeat after me: addition is commutative!
...
Repeat after me: disjunction is commutative!

(I know, it sounds much much worse.)
Just for restoring my reputation:
I know those rules already and I know how to apply them

A computer might implement checking the conditions in a different way though.
It might check all conditions for truth and state the result afterwards.
Or it might be implemented to do something like an IF-ELSEIF-ELSE chain would do, meaning if it hits first it sticks to it. Why should a computer test more than one condition if the "true"-outcome has already been reached?

I have seen such implementations before. This of course saves CPU cycles noticably only for large numbers of repetitions. It all depends on the implementation of the checking routine.

And this I have learned AFTER school in university lectures about algorithms and data structures )
 

The Following 2 Users Say Thank You to Amboss For This Useful Post: