aboutsummaryrefslogtreecommitdiff
path: root/docs/doc/logic.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/doc/logic.html')
-rw-r--r--docs/doc/logic.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/doc/logic.html b/docs/doc/logic.html
index 01873e6b..92a03e43 100644
--- a/docs/doc/logic.html
+++ b/docs/doc/logic.html
@@ -39,7 +39,7 @@
</pre>
<p>As with logical And and Or, any value and 0 is 0, while any value or 1 is 1. The other boolean values give the identity values for the two functions: 1 and any value gives that value, as does 0 or the value.</p>
<h2 id="why-not-gcd-and-lcm"><a class="header" href="#why-not-gcd-and-lcm">Why not GCD and LCM?</a></h2>
-<p>The main reason for omitting these functions is that they are complicated and, when applied to real or complex numbers, require a significant number of design decisions where there is no obvious choice (for example, whether to use comparison tolerance). On the other hand, these functions are fairly easy to implement, which allows the programmer to control the details, and also add functionality such as the extended GCD. Reference implementations for gcd and lcm are available on <a href="https://mlochbaum.github.io/bqncrate">bqncrate</a> (<a href="https://mlochbaum.github.io/bqncrate/?q=gcd">gcd</a>, <a href="https://mlochbaum.github.io/bqncrate/?q=lcm">lcm</a>).</p>
+<p>The main reason for omitting these functions is that they are complicated and, when applied to real or complex numbers, require a significant number of design decisions where there is no obvious choice (for example, whether to use comparison tolerance). On the other hand, these functions are fairly easy to implement, which allows the programmer to control the details, and also add functionality such as the extended GCD. Possible implementations for GCD and LCM are shown in <a href="https://mlochbaum.github.io/bqncrate">bqncrate</a> (<a href="https://mlochbaum.github.io/bqncrate/?q=gcd">GCD</a>, <a href="https://mlochbaum.github.io/bqncrate/?q=lcm">LCM</a>).</p>
<p>A secondary reason is that the GCD falls short as an extension of Or, because its identity value 0 is not total. <code><span class='Number'>0</span><span class='Function'>∨</span><span class='Value'>x</span></code>, for a real number <code><span class='Value'>x</span></code>, is actually equal to <code><span class='Function'>|</span><span class='Value'>x</span></code> and not <code><span class='Value'>x</span></code>: for example, <code><span class='Number'>0</span><span class='Function'>∨</span><span class='Number'>¯2</span></code> is <code><span class='Number'>2</span></code> in APL. This means the identity <code><span class='Number'>0</span><span class='Function'>∨</span><span class='Value'>x</span> <span class='Gets'>←→</span> <span class='Value'>x</span></code> isn't reliable in APL.</p>
<h2 id="identity-values"><a class="header" href="#identity-values">Identity values</a></h2>
<p>It's common to apply a <a href="fold.html">fold</a> <code><span class='Function'>∧</span><span class='Modifier'>´</span></code> or <code><span class='Function'>∨</span><span class='Modifier'>´</span></code> to a list (checking whether all elements are true and whether any are true, respectively), and so it's important for extensions to And and Or to share their <a href="fold.html#identity-values">identity</a> value. <a href="arithmetic.html#additional-arithmetic">Minimum and Maximum</a> do match And and Or when restricted to booleans, but they have different identity values. It would be dangerous to use Maximum to check whether any element of a list is true because <code><span class='Function'>⌈</span><span class='Modifier'>´</span><span class='Bracket'>⟨⟩</span></code> yields <code><span class='Number'>¯∞</span></code> instead of <code><span class='Number'>0</span></code>—a bug waiting to happen. To avoid this the programmer would have to use an initial value <code><span class='Value'>𝕨</span></code> of <code><span class='Number'>0</span></code>, which is easy to forget.</p>