NAND


Language operator NAND


10
20  a NAND b
30
Bitwise exclusive NOT AND.


See examples


If there is insufficient information on this page and you wish learn more about NAND, please send an email to smallbasic@gmail.com. You can help to improve information about NAND by submitting an article using the comments link below. Note, an offline language reference text file is now avialable – see the Download section.

Comments


' Two's complement is the standard way of representing negative integers in binary.
' The sign is changed by inverting all of the bits and adding one.

Def invsgn(n) = ((n Nand n) + 1) - Frac(n) ' invert the sign of n

While True Do
  Input "Enter a number (Enter empty to stop) : ", n
  If Isstring(n) Then
    Stop
  Endif

  Print "This is the number with inverted sign: "; invsgn(n)
  Print
Wend