aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2022-11-24 08:58:41 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2022-11-24 09:02:46 -0500
commit976bd82fb0e830876cca117c302c8a19048033a4 (patch)
treef2ae15eac426087fa42051c2ff00bf1d0b56b9bd /doc
parent9997b5b5edcab4fccb2485ef54faa2d27225c411 (diff)
Specify more •math functions and implement JS Fact, Comb, GCD, LCM
Diffstat (limited to 'doc')
-rw-r--r--doc/logic.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/logic.md b/doc/logic.md
index 793699f1..53e9409e 100644
--- a/doc/logic.md
+++ b/doc/logic.md
@@ -98,7 +98,7 @@ Some other logical identities don't always hold. For example, in boolean logic A
### Why not GCD and LCM?
-APL provides [GCD](https://aplwiki.com/wiki/GCD) and [LCM](https://aplwiki.com/wiki/LCM) as extensions of And and Or, while BQN doesn't make these functions primitives. The main reason for omitting them functions is that they are complicated and, when applied to real or complex numbers, require a significant number of design decisions where there's 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 [bqncrate](https://mlochbaum.github.io/bqncrate) ([GCD](https://mlochbaum.github.io/bqncrate/?q=gcd), [LCM](https://mlochbaum.github.io/bqncrate/?q=lcm)).
+APL provides [GCD](https://aplwiki.com/wiki/GCD) and [LCM](https://aplwiki.com/wiki/LCM) as extensions of And and Or, while BQN doesn't make these functions primitives. The main reason for omitting them functions is that they are complicated and, when applied to real or complex numbers, require a significant number of design decisions where there's 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 [bqncrate](https://mlochbaum.github.io/bqncrate) ([GCD](https://mlochbaum.github.io/bqncrate/?q=gcd), [LCM](https://mlochbaum.github.io/bqncrate/?q=lcm)), and `•math.GCD` and `•math.LCM` are also supported.
A secondary reason is that the GCD falls short as an extension of Or, because its identity value 0 is not total. `0∨x`, for a real number `x`, is actually equal to `|x` and not `x`: for example, `0∨¯2` is `2` in APL. This means the identity `0∨x ←→ x` isn't reliable in APL.