Not Equal to: Difference between revisions

Jump to navigation Jump to search
418 bytes added ,  10:19, 4 May 2020
m
m (2 revisions imported: Migrate from miraheze)
(3 intermediate revisions by 2 users not shown)
Line 11: Line 11:
== Boolean function ==
== Boolean function ==


When the arguments to Not Equal to are [[Boolean]], it is the [[wikipedia:exclusive or|exclusive or]] or xor function. Xor is one of the most important [[Boolean function]]s because it is equivalent to [[addition]] of the arguments with [[modulus]] 2. Like addition, it is [[wikipedia:Commutative property|commutative]] and [[wikipedia:Associative property|associative]]. It is also equivalent to [[subtraction]] with modulus 2 because the [[Minus|negative]] of a number is the same as the original number (mod 2): the negative of an odd number is still odd, and the negative of an even number is still even.
When the arguments to Not Equal to are [[Boolean]], it is the [[wikipedia:exclusive or|exclusive or]] or xor function:
{|class=wikitable
!<source lang=apl inline>≠</source>!!<source lang=apl inline>0</source>!!<source lang=apl inline>1</source>
|-
!<source lang=apl inline>0</source>
|<source lang=apl inline>0</source>||<source lang=apl inline>1</source>
|-
!<source lang=apl inline>1</source>
|<source lang=apl inline>1</source>||<source lang=apl inline>0</source>
|}
Xor is one of the most important [[Boolean function]]s because it is equivalent to [[addition]] of the arguments with [[modulus]] 2. Like addition, it is [[wikipedia:Commutative property|commutative]] and [[wikipedia:Associative property|associative]]. It is also equivalent to [[subtraction]] with modulus 2 because the [[Minus|negative]] of a number is the same as the original number (mod 2): the negative of an odd number is still odd, and the negative of an even number is still even.


[[Reduction]] of a Boolean [[vector]] using Not Equal to yields 1 if there were an odd number of 1s in the argument and 0 otherwise. In APL, if <source lang=apl inline>v</source> is a Boolean vector then <source lang=apl inline>≠/v</source> {{←→}} <source lang=apl inline>2|+/v</source>.
[[Reduction]] of a Boolean [[vector]] using Not Equal to yields 1 if there were an odd number of 1s in the argument and 0 otherwise. In APL, if <source lang=apl inline>v</source> is a Boolean vector then <source lang=apl inline>≠/v</source> {{←→}} <source lang=apl inline>2|+/v</source>.
Line 23: Line 33:
* J [http://www.jsoftware.com/help/dictionary/d222.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/tildeco#dyadic NuVoc]
* J [http://www.jsoftware.com/help/dictionary/d222.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/tildeco#dyadic NuVoc]


{{APL built-ins}}
{{APL built-ins}}[[Category:Primitive functions]][[Category:Comparison functions]]

Navigation menu