Post Reply 
Proof of X≤Y inverse to X˃Y
09-01-2018, 07:51 PM
Post: #9
RE: Proof of X≤Y inverse to X˃Y
(09-01-2018 08:40 AM)Gamo Wrote:  Recently I try to do the inverse of the [X≤Y] to [X˃Y]
To get [X˃Y] this must use [X≤Y] three times.

No, this can and will not work. Three times the same test does exactly the same as one single test.
So...

X≤Y?
X≤Y?
X≤Y?

...is the same as a single X≤Y? test. Just with two wasted program lines.
Do you want a proof?

(09-01-2018 12:57 PM)Gamo Wrote:  When doing the inverse logic in program next line will be False follow by True

01 Inverse Logic
02 False
03 True

To invert a test simply have it followed by another test that always is false.
Your third step ("True") does not change anything and can be removed.

Example: if you know that X definitely is not zero, the "always false" step can be "X=0?".
This way...

X≤Y?
X=0?

...becomes an "X>Y?" test.

BUT: On the 12C or other calculators with line addressing inverting a test can be done even easier: simply have the test followed by a GTO to the second next line.

Code:
21 ...
22 X≤Y?
23 GTO 25
24 ...     <= this line is executed if X>Y, else it is skipped
25 ...     program continues here

Of course you can also skip two or more lines.
Example: if X>Y store R1 into R2.

Code:
21 ...
22 X≤Y?
23 GTO 26
24 RCL 1   these two lines are only executed
25 STO 2   if X>Y, else they are skipped
26 ...     program continues here

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Proof of X≤Y inverse to X˃Y - Gamo - 09-01-2018, 08:40 AM
RE: Proof of X≤Y inverse to X˃Y - Gamo - 09-01-2018, 12:57 PM
RE: Proof of X≤Y inverse to X˃Y - Dieter - 09-01-2018 07:51 PM
RE: Proof of X≤Y inverse to X˃Y - Gene - 09-01-2018, 08:27 PM
RE: Proof of X≤Y inverse to X˃Y - Gene - 09-01-2018, 02:04 PM
RE: Proof of X≤Y inverse to X˃Y - Gamo - 09-02-2018, 01:29 AM
RE: Proof of X≤Y inverse to X˃Y - Gamo - 09-02-2018, 01:52 PM
RE: Proof of X≤Y inverse to X˃Y - Gamo - 09-02-2018, 02:40 PM



User(s) browsing this thread: 1 Guest(s)