Not Equal to: Difference between revisions
m (Text replacement - "http://help.dyalog.com" to "https://help.dyalog.com") |
(→Documentation: BQN) |
||
Line 32: | Line 32: | ||
* [http://microapl.com/apl_help/ch_020_020_340.htm APLX] | * [http://microapl.com/apl_help/ch_020_020_340.htm APLX] | ||
* 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] | ||
* [https://mlochbaum.github.io/BQN/doc/arithmetic.html#comparisons BQN] | |||
{{APL built-ins}}[[Category:Primitive functions]][[Category:Comparison functions]] | {{APL built-ins}}[[Category:Primitive functions]][[Category:Comparison functions]] |
Revision as of 02:22, 28 May 2022
≠
|
Not Equal to (≠
) is a comparison function which tests whether argument elements are tolerantly unequal. It is the negation of Equal to (=
). Thus it returns 0 if the elements being compared match and 1 if they do not.
Examples
See Equal to for a more detailed treatment of equality testing.
2 2.5 3 3.5 ≠ 2.5 1 0 1 1
Boolean function
When the arguments to Not Equal to are Boolean, it is the exclusive or or xor function:
≠ |
0 |
1
|
---|---|---|
0
|
0 |
1
|
1
|
1 |
0
|
Xor is one of the most important Boolean functions because it is equivalent to addition of the arguments with modulus 2. Like addition, it is commutative and associative. It is also equivalent to subtraction with modulus 2 because the 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 v
is a Boolean vector then ≠/v
2|+/v
.
External links
Documentation
- Dyalog
- APLX
- J Dictionary, NuVoc
- BQN