From b6185d5029e2adcc721c0cc2097f591d9a09f135 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sun, 26 Jun 2022 21:00:25 -0400 Subject: I am in editing stepped in so far that, should I wade no more, returning were as tedious as go o'er. --- docs/doc/arithmetic.html | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'docs/doc/arithmetic.html') diff --git a/docs/doc/arithmetic.html b/docs/doc/arithmetic.html index 46831cad..9e511044 100644 --- a/docs/doc/arithmetic.html +++ b/docs/doc/arithmetic.html @@ -22,6 +22,7 @@ Symbol Dyad Monad +default 𝕨 @@ -29,35 +30,41 @@ + Add (Conjugate) +– - Subtract Negate +0 × Multiply Sign +– ÷ Divide Reciprocal +1 Power Exponential +e Root Square root +2 -

The dyadic functions should all be familiar operations, and most likely you are familiar with the symbols +-×÷√. In fact the large × and ÷ might strike you as a regression to early school years, before division was written vertically and multiplication with a simple dot or no symbol at all (BQN reserves the distinction of having no symbol for application and composition). Like these, raising to a power or exponentiation is made regular by giving it the symbol —a true Unicode star and not an asterisk. The Root function is also modified to be a binary function, which raises 𝕩 to the power ÷𝕨. In ASCII programming languages ×, ÷, and are often written *, /, and ^ or **.

+

The dyadic (two-argument) functions should all be familiar operations, and most likely you know the symbols +-×÷√. In fact the large × and ÷ might strike you as a regression to early school years, before division was written vertically and multiplication with a simple dot or no symbol at all. Like these, raising to a power or exponentiation is made regular by giving it the symbol —a true Unicode star and not an asterisk. The Root function is also modified to be a binary function, which raises 𝕩 to the power ÷𝕨. In ASCII programming languages ×, ÷, and are often written *, /, and ^ or **.

↗️
    2 + 3105
 ⟨ 5 3 2 7 ⟩
 
@@ -76,7 +83,7 @@
     4  81
 3
 
-

Each of these functions also has a meaning with only one argument, although in mathematics only - does. The relationship of negation to addition is extended to division (relative to multiplication) as well, so that ÷𝕩 gives the reciprocal 1÷𝕩 of its argument. Power () is also extended with a default left argument of Euler's number e. The default left argument for Root is 2, giving the well-known Square Root.

+

Each of these functions also has a meaning with only one argument, although mathematics only defines - in this way. The relationship of negation to addition is extended to division (relative to multiplication) as well, so that ÷𝕩 gives the reciprocal 1÷𝕩 of its argument. Power () is also extended with a default left argument of Euler's number e. The default left argument for Root is 2, giving the well-known Square Root.

↗️
    - 6
 ¯6
 
@@ -90,7 +97,7 @@
 ⟨ 0 1 1.414213562373095 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.

+

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

↗️
     10
 2.302585092994046
 
@@ -186,7 +193,7 @@
     | ¯∞¯602
 ⟨ ∞ 6 0 2 ⟩
 
-

Floor () returns the largest integer less than or equal to the argument, and Ceiling () returns the smallest one greater than or equal to it. For this purpose ¯∞ and are treated as integers, so that the floor or ceiling of an infinity is itself. Absolute value removes the argument's sign by negating it if it is less than 0, so that its result is always non-negative.

+

Floor () returns the largest integer less than or equal to the argument, and Ceiling () returns the smallest one greater than or equal to it. For this purpose ¯∞ and are treated as integers, so that the floor or ceiling of an infinity is itself. Absolute value removes the sign of 𝕩 by negating it if it's less than 0, so that its result is always non-negative.

Minimum () returns the smaller of its two arguments, and Maximum () returns the larger. These functions are loosely related to Floor and Ceiling in their use of comparison, and can be defined similarly: for example, the minimum of two numbers is the largest number less than or equal to both of them. To take the minimum or maximum of an entire list, use a fold.

↗️
    3  8
 ⟨ 0 1 2 3 3 3 3 3 ⟩
@@ -194,7 +201,7 @@
      8
 ⟨ 7 6 5 4 4 5 6 7 ⟩
 
-

Modulus (|) is similar to the modular division operation written % in C-like languages, but it takes the arguments in the opposite order, and differs in its handling of negative arguments. It's defined to be {𝕩-𝕨×⌊𝕩÷𝕨}, except that the multiplication should always return 0 if its right argument is 0, even if 𝕨 is infinite.

+

Modulus (|) is similar to the modular division operation written % in C-like languages, but it takes the arguments in the opposite order, and differs in its handling of negative arguments. It's the same computation as {𝕩-𝕨×⌊𝕩÷𝕨} but probably has better precision.

↗️
    3 | 8
 ⟨ 0 1 2 0 1 2 0 1 ⟩
 
@@ -291,11 +298,11 @@
   ⟨ ⟨ 1 0 ⟩ 1 1 ⟩  
                   ┘
 
-

With two arguments many combinations are possible. Arrays of equal shape are matched element-wise, and an atom is matched to every element of an array.

-↗️
    102030 + 567
+

With two arguments, many combinations are possible. Arrays of equal shape are matched element-wise, and an atom is matched to every element of an array.

+↗️
    102030 + 567
 ⟨ 15 26 37 ⟩
 
-    10 × 432678
+    10 × [432,678]
 ┌─          
 ╵ 40 30 20  
   60 70 80  
-- 
cgit v1.2.3