HP Forums
NOT AND INSTRUCTION ? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: NOT AND INSTRUCTION ? (/thread-13423.html)



NOT AND INSTRUCTION ? - ggauny@live.fr - 08-05-2019 09:11 AM

Hi all,

I wonder if NOT AND boolean instruction exist in the HP Prime. I think no, but how can we emule this instruction ?
I try since a moment but without success.

Maybe one can help me ?

Goog day.


RE: NOT AND INSTRUCTION ? - chromos - 08-05-2019 12:36 PM

I think Gérard meant 'NAND' command.

If logical values are stored in list L1 then something like this could work:

[attachment=7587]

Edit: strikethrough text was reaction to previous advice of another user and that post is now deleted.


RE: NOT AND INSTRUCTION ? - StephenG1CMZ - 08-05-2019 01:55 PM

Thanks for that suggestion Chromos.
If it is NAND that is wanted I would suggest:
Code:

EXPORT NAND(LST)
BEGIN
 IF SIZE(LST)==1 THEN
  RETURN (LST(1)==0);
 END;
 RETURN NOT (ΠLIST(LST));
END;

That has the advantage of also working with a single input, which the built-in list function does not handle.


RE: NOT AND INSTRUCTION ? - ggauny@live.fr - 08-05-2019 02:22 PM

Yes it is NAND I was speaking.
Thank you for reply.