Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
logical operators Q
#21
Quote:AND is also inefficient. It checks each truth value and doesn't exit out once a FALSE is reached.

Yeah, that is what i am saying, but how do you get around testing both expressions with OR, NOT, XOR, and EQV? You can't.
Reply
#22
With OR, AND, and IMP, you don't need to test both expressions.

With XOR and EQV... well I suppose that could be left...
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#23
I don't know about IMP (what is it?), but with XOR you must test both expressions.
Lets say you have this:
Code:
IF a = 10 XOR b = 20 THEN...

If the first expression is true, you need to keep testing to see if the other is false. And vice versa. But you are correct with OR.
Reply
#24
IMP (implies) is a bit silly, but it's still there.

"a IMP b" is the same thing as "a"

As in, if A is true, then TRUE ELSE FALSE......
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)