HP 35s Logic Operator AND
06-19-2016, 02:28 PM (This post was last modified: 06-19-2016 02:34 PM by Dieter.)
Post: #4
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: HP 35s Logic Operator AND
(06-19-2016 07:18 AM)Thomas Radtke Wrote:  In program mode, use something like this:
(...)
Untested, also you don't actually need more than one lable as you can branch to any line within a program.

This looks a bit complicated. I assume you want to do something like this:

Code:
0 FS? 1 e^x   // or any other command that turns a 0 into a 1 0 FS? 2 e^x AND

Or even better, using the 35s NOT operator:

Code:
0 FS? 1 NOT 0 FS? 2 NOT AND

This yields a 1 resp. –1 if both flags are set, and a 0 otherwise. So the next step after this is a simple X≠0? which actually tests whether both flags are set. Or you could also use an X=0? instead if you want to test if at least one flag is cleared.

This method can be extended to many more logical combinations. The basic idea is: have the tests return a 0 if false or a 1 or -1 if true, and then combine their results with the 35s logic operators.

Dieter
 « Next Oldest | Next Newest »

 Messages In This Thread HP 35s Logic Operator AND - MNH - 06-19-2016, 06:37 AM RE: HP 35s Logic Operator AND - Thomas Radtke - 06-19-2016, 07:18 AM RE: HP 35s Logic Operator AND - Dieter - 06-19-2016 02:28 PM RE: HP 35s Logic Operator AND - Thomas Radtke - 06-19-2016, 04:40 PM RE: HP 35s Logic Operator AND - Dieter - 06-19-2016, 01:40 PM RE: HP 35s Logic Operator AND - MNH - 06-19-2016, 11:37 PM

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