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/tutorial/expression.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/tutorial/expression.html') diff --git a/docs/tutorial/expression.html b/docs/tutorial/expression.html index 6c654cd7..52de145d 100644 --- a/docs/tutorial/expression.html +++ b/docs/tutorial/expression.html @@ -97,7 +97,7 @@

You could use Power to take square roots and n-th roots, but BQN has a primitive for this purpose. If no left argument is provided, then it's the Square Root function; with a left argument it's called Root, and raises the right argument to the power of one divided by the left argument.

↗️
     2
-1.414213562373095
+1.4142135623730951
     3  27
 3
 
@@ -117,7 +117,7 @@

I bet if you try hard you'll remember how much you hated learning to do exponentiation before multiplication and division before addition and subtraction. Didn't I tell you Earth was a confusing place? BQN treats all functions—not only primitives, but also the ones you define—the same way. They're evaluated from right to left, and parentheses form subexpressions that are evaluated entirely before they can be used.

For a longer example, here's an expression for the volume of a sphere with radius 2.

↗️
    (4÷3) × π × 23
-33.51032163829112
+33.510321638291124
 

The evaluation order is diagrammed below, with the function at the highest level evaluated first, then × below it, and so on. The effect of the parentheses is that ÷ is evaluated before the leftmost ×.

-- cgit v1.2.3