A quick lesson on: What is IMP?
#9
To explain the above, let me break down and simplify the logic for you guys.

Remember A IMP B is the *exact* same thing as NOT A OR B. I'm going to expand this equivalent expression, as everyone has a better grasp on the NOT and OR commands.

Logically speaking, NOT A OR B is basically a truth check to see if either of our two conditions are TRUE, and if so, then we count the statement as TRUE. It's basically IF (NOT A) OR (B) THEN.... <-- I would hope it's easy enough to see the 2 conditions we're checking here.

B .... would be TRUE, as long as it's not 0. That's the basic truth of BASIC -- anything non-zero is counted as TRUE. With (Whatever) OR B, as long as B is TRUE, we evaluate the whole statement as TRUE. B **has** to be zero for the statement to ever be FALSE.

IF B <> 0 THEN the statement is true, regardless of whatever the left side of the statement is. We're checking OR B after all.

For the left side, we're evaluating NOT A. Again, *any* non-zero number would be TRUE. Knowing that, what's the *ONLY* value NOT A can be to become 0??

-1!!

NOT -1 = 0. Every other value equals something else. *ONLY* when A is -1, do we have a FALSE statement of the left side of that OR operator. Any other value is TRUE.

Which brings us to this simple conclusion:

IF A = -1 AND B = 0 THEN
we have a FALSE result
ELSE
everything else is TRUE
END IF

So A = 10... TRUE! Who cares what B is! I can assure you, it's TRUE just from the A side of things...

B = 10? That's got to be TRUE. Doesn't matter what A is, the B side alone defines it as TRUE.

The **ONLY** way you get FALSE is when A = -1 AND B = 0. Any other values than those two and you get TRUE.
Reply


Messages In This Thread
A quick lesson on: What is IMP? - by SMcNeill - 05-02-2022, 12:35 AM
RE: A quick lesson on: What is IMP? - by SMcNeill - 05-09-2022, 02:54 AM
RE: A quick lesson on: What is IMP? - by Dimster - 07-27-2022, 01:42 PM
RE: A quick lesson on: What is IMP? - by SMcNeill - 07-27-2022, 02:32 PM
RE: A quick lesson on: What is IMP? - by Dimster - 07-27-2022, 05:22 PM
RE: A quick lesson on: What is IMP? - by SMcNeill - 07-27-2022, 07:03 PM
RE: A quick lesson on: What is IMP? - by SMcNeill - 07-27-2022, 07:27 PM
RE: A quick lesson on: What is IMP? - by Pete - 07-27-2022, 07:37 PM
RE: A quick lesson on: What is IMP? - by SMcNeill - 07-27-2022, 07:59 PM
RE: A quick lesson on: What is IMP? - by Pete - 07-27-2022, 10:14 PM
RE: A quick lesson on: What is IMP? - by Dimster - 07-28-2022, 12:51 PM
RE: A quick lesson on: What is IMP? - by SMcNeill - 07-28-2022, 04:34 PM
RE: A quick lesson on: What is IMP? - by Dimster - 07-28-2022, 04:53 PM
RE: A quick lesson on: What is IMP? - by JRace - 07-28-2022, 05:38 PM
RE: A quick lesson on: What is IMP? - by JRace - 11-05-2022, 03:50 AM
RE: A quick lesson on: What is IMP? - by vince - 11-10-2022, 06:56 AM



Users browsing this thread: 7 Guest(s)