diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-12-30 20:57:20 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-12-30 20:57:20 -0500 |
| commit | 8ddad454b30cdafc9bbdc0cbd51c653bee8a87e5 (patch) | |
| tree | 9c267498157b26caf82ff5e0baf9b190a5e84837 /docs/doc | |
| parent | 2f4f1d38f0aec449c39a15cdaaa5e160b4a78a4e (diff) | |
Rebuild with CBQN's new number formatting (ryu)
Diffstat (limited to 'docs/doc')
| -rw-r--r-- | docs/doc/arithmetic.html | 2 | ||||
| -rw-r--r-- | docs/doc/fold.html | 2 | ||||
| -rw-r--r-- | docs/doc/under.html | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/docs/doc/arithmetic.html b/docs/doc/arithmetic.html index 918bd9c5..7c8a900a 100644 --- a/docs/doc/arithmetic.html +++ b/docs/doc/arithmetic.html @@ -94,7 +94,7 @@ ⟨ 1 2.718281828459045 7.38905609893065 ⟩ <span class='Function'>√</span> <span class='Number'>0</span><span class='Ligature'>‿</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>4</span> -⟨ 0 1 1.414213562373095 2 ⟩ +⟨ 0 1 1.4142135623730951 2 ⟩ </pre> <p>Take note of the difference between the function <code><span class='Function'>-</span></code>, and the "high minus" character <code><span class='Number'>¯</span></code>, which is a part of <a href="token.html#numbers">numeric notation</a>. Also shown is the number <code><span class='Number'>∞</span></code>, which BQN supports along with <code><span class='Number'>¯∞</span></code> (but depending on implementation BQN may or may not keep track of <code><span class='Number'>¯0</span></code>. Integer optimization loses the distinction so it's best not to rely on it).</p> <p>The logarithm is written with <a href="undo.html">Undo</a>: <code><span class='Function'>⋆</span><span class='Modifier'>⁼</span></code>. As with Power, the default base is <em>e</em>, giving a natural logarithm.</p> diff --git a/docs/doc/fold.html b/docs/doc/fold.html index d59caf97..4d73e8c0 100644 --- a/docs/doc/fold.html +++ b/docs/doc/fold.html @@ -151,7 +151,7 @@ </pre> <p>And the operand <code><span class='Function'>+</span><span class='Modifier2'>⟜</span><span class='Function'>÷</span></code> is a quick way to compute a <a href="https://en.wikipedia.org/wiki/Continued_fraction">continued fraction</a>'s value from a list of numbers. Here are a few terms from the continued fraction for <em>e</em>.</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=K+KfnMO3wrQgMuKAvzHigL8y4oC/MeKAvzHigL804oC/MeKAvzE=">↗️</a><pre> <span class='Function'>+</span><span class='Modifier2'>⟜</span><span class='Function'>÷</span><span class='Modifier'>´</span> <span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>4</span><span class='Ligature'>‿</span><span class='Number'>1</span><span class='Ligature'>‿</span><span class='Number'>1</span> -2.71830985915493 +2.7183098591549295 </pre> <h3 id="initial-element"><a class="header" href="#initial-element">Initial element</a></h3> <p>When <code><span class='Function'>𝔽</span></code> isn't just an arithmetic primitive, folding with no initial element can be dangerous. Even if you know <code><span class='Value'>𝕩</span></code> isn't empty, saving you from an "Identity not found" error, the case with only one element can easily violate expectations. Here's a somewhat silly example of a function meant to merge elements of the argument into a single list (<code><span class='Function'>∾⥊</span><span class='Modifier'>¨</span></code> is a much better way to do this):</p> diff --git a/docs/doc/under.html b/docs/doc/under.html index 4ec761a8..df79f48c 100644 --- a/docs/doc/under.html +++ b/docs/doc/under.html @@ -82,7 +82,7 @@ <h2 id="computational-under"><a class="header" href="#computational-under">Computational Under</a></h2> <p>Computational Under is based on <a href="undo.html">Undo</a> (<code><span class='Modifier'>⁼</span></code>), and applies whenever structural Under doesn't. It's still limited, because Undo doesn't work on many or even most functions. One common use is with the square function <code><span class='Function'>×</span><span class='Modifier'>˜</span></code>, for computations such as finding the magnitude of a vector, or a <a href="https://en.wikipedia.org/wiki/Root_mean_square">root-mean-square</a> average like the one below.</p> <a class="replLink" title="Open in the REPL" target="_blank" href="https://mlochbaum.github.io/BQN/try.html#code=KCvCtMO34omgKeKMvijDl8ucKSAy4oC/M+KAvzTigL81">↗️</a><pre> <span class='Paren'>(</span><span class='Function'>+</span><span class='Modifier'>´</span><span class='Function'>÷≠</span><span class='Paren'>)</span><span class='Modifier2'>⌾</span><span class='Paren'>(</span><span class='Function'>×</span><span class='Modifier'>˜</span><span class='Paren'>)</span> <span class='Number'>2</span><span class='Ligature'>‿</span><span class='Number'>3</span><span class='Ligature'>‿</span><span class='Number'>4</span><span class='Ligature'>‿</span><span class='Number'>5</span> -3.674234614174767 +3.6742346141747673 </pre> <p>This average is the square root of the average of the squares of the arguments, and <code><span class='Modifier2'>⌾</span></code> lets us combine the two square-y steps. Here there are two possible solutions because <code><span class='Number'>¯3.67</span><span class='Value'>…</span></code> has the same square as the positive result; BQN of course uses the principal root. Similarly, <code><span class='Modifier2'>⌾</span><span class='Function'>÷</span></code> can be used for a harmonic sum or mean (you might notice that computational Under is a lot more mathy than the structural one).</p> <p>Under is the idiomatic way to do a round-to-nearest function:</p> |
