Re: Logic Operators with 3 arguments

Tech-Archive recommends: Fix windows errors by optimizing your registry



Terry Olsen ha scritto:

Thanks Terry,

let's see tham for general numbers (bitwise operators, instead of
boolean).

If I understand correctly, you are suggesting:

1. Return Not (a and b and c)
2. Return Not (a or b or c)

I am not sure for the 3-rd. Would that be:

3. Return Not (a xor b xor c)

?????????????? or what ?

-P

Just look at the truth table for these and you'll see how to do it.

http://hyperphysics.phy-astr.gsu.edu/HBASE/electronic/nand.html
Private Function NAND(byval a as boolean, byval b as boolean, byval c as
boolean) as boolean
if a=True and b=True and c=True then Return False
Return True
End Function

http://hyperphysics.phy-astr.gsu.edu/HBASE/electronic/nor.html
Private Function NOR(byval a as boolean, byval b as boolean, byval c as
boolean) as boolean
if a=True or b=True or c=True then Return False
Return True
End Function

http://hyperphysics.phy-astr.gsu.edu/HBASE/electronic/xnor.html
Private Function XNOR(byval a as boolean, byval b as boolean, byval c as
boolean) as boolean
if a=b and a=c then Return True
Return False
End Function


.



Relevant Pages

  • Re: Warum wird bei "If False then ..." der Then-Teil ausgeführt?
    ... Private Function testAs Boolean ... > sollten, gibt die Funktion true. ... Private Function test(ByVal Wert As Boolean) As Boolean ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • Re: DoEvents?
    ... Static bPlaying As Boolean ... Private Function PlayASoundAs Boolean ... : Const SND_FILENAME = &H20000 ...
    (microsoft.public.vb.general.discussion)
  • Re: Print a return value without storing it (also IIF and ternary operator)
    ... functions return values by assigning the value to be returned inside ... private function fooas boolean ... if somecondition = whatIexpect then ...
    (microsoft.public.vb.general.discussion)
  • Re: Negative Number
    ... > Private Function IsNegativeAs Boolean ... Private Function IsNegative(ByVal inVal As Variant) As Boolean ... By the way, with regard to your IsPositive, would it be faster this way? ...
    (microsoft.public.vb.general.discussion)
  • Re: shorts and longs
    ... Private m_EndianSwap As Boolean ... Dim TempWord As Integer ... Private Function ReadDWordAs Currency ... Dim TempDWord As Long ...
    (microsoft.public.vb.general.discussion)