From 8ddad454b30cdafc9bbdc0cbd51c653bee8a87e5 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 30 Dec 2022 20:57:20 -0500 Subject: Rebuild with CBQN's new number formatting (ryu) --- docs/doc/arithmetic.html | 2 +- docs/doc/fold.html | 2 +- docs/doc/under.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/doc') 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 ⟩ 0124 -⟨ 0 1 1.414213562373095 2 ⟩ +⟨ 0 1 1.4142135623730951 2 ⟩

Take note of the difference between the function -, and the "high minus" character ¯, which is a part of numeric notation. Also shown is the number , which BQN supports along with ¯∞ (but depending on implementation BQN may or may not keep track of ¯0. Integer optimization loses the distinction so it's best not to rely on it).

The logarithm is written with Undo: . As with Power, the default base is e, giving a natural logarithm.

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 @@

And the operand +÷ is a quick way to compute a continued fraction's value from a list of numbers. Here are a few terms from the continued fraction for e.

↗️
    +÷´ 21211411
-2.71830985915493
+2.7183098591549295
 

Initial element

When 𝔽 isn't just an arithmetic primitive, folding with no initial element can be dangerous. Even if you know 𝕩 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 (∾⥊¨ is a much better way to do this):

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 @@

Computational Under

Computational Under is based on Undo (), 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 ט, for computations such as finding the magnitude of a vector, or a root-mean-square average like the one below.

↗️
    (+´÷≠)(ט) 2345
-3.674234614174767
+3.6742346141747673
 

This average is the square root of the average of the squares of the arguments, and lets us combine the two square-y steps. Here there are two possible solutions because ¯3.67 has the same square as the positive result; BQN of course uses the principal root. Similarly, ÷ can be used for a harmonic sum or mean (you might notice that computational Under is a lot more mathy than the structural one).

Under is the idiomatic way to do a round-to-nearest function:

-- cgit v1.2.3