TITLE: In what sense is GCD an extension of boolean OR?
QUESTION [8 upvotes]: The J Programming langauge has an operator which acts as both the GCD and boolean Or.  The J Primer has this note about it:

The GCD is a useful extension of the domain of the or function to non-boolean arguments. 

As J is a highly mathematical language, I assume this extension has a basis in mathematics as well.
In what sense, if any, can the the GCD be considered an "extension" of boolean "Or"?

REPLY [18 votes]: In the ordering $\preceq$ of nonnegative integers by divisibility, 1 is the least element and 0 is the greatest, and we have for instance
$$
1\preceq 2\preceq 6\preceq 12\preceq\dots\preceq 0.$$
In this ordering, gcd is the same as meet (greatest lower bound), which is dual to least upper bound, which is what boolean OR is for $\{0,1\}$.
So it makes sense if you think of numbers as "degrees of truth", where multiplicative factors are evidence of falsehood.
See also: What is gcd(0,0)?