From 0c716e4c6b7c2c44bbfd02b6503cae66af7b7480 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 28 Jan 2022 16:34:41 -0500 Subject: Separate syntax highlighting category for header/body characters ;:? --- docs/spec/complex.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/spec/complex.html') diff --git a/docs/spec/complex.html b/docs/spec/complex.html index a5d4826e..3ef70e13 100644 --- a/docs/spec/complex.html +++ b/docs/spec/complex.html @@ -8,7 +8,7 @@

Complex numbers are an optional extension to BQN's numeric system. If they are supported, the following functionality must also be supported. This extension is a draft and is versioned separately from the rest of the BQN specification.

A complex number is a value with two components, a real part and an imaginary part. The type of each component is a real number, as described in the type specification. However, this type replaces the number type given there.

The numeric literal notation is extended with the character i, which separates two real-valued components (in effect, it has lower "precedence" than other characters like e and ¯). If a second component is present (using i or I), that component's value is multiplied by the imaginary unit i and added to the first component; otherwise the value is the first component's value without modification. As with real numbers, the exact complex number given is rounded to fit the number system in use.

-
complexnumber = number ( ( "i" | "I" ) number )?
+
complexnumber = number ( ( "i" | "I" ) number )?
 

Basic arithmetic functions +-×÷ are extended to complex numbers. A monadic case for the function + is added, which returns the conjugate argument: a number with real part equal to the real part of 𝕩 and imaginary part negated relative to 𝕩.

The primitive function is added: the character forms a primitive function token, and its value is the function {𝕨+0j1×𝕩}. This function multiplies 𝕩 by i, then adds 𝕨 if given.

-- cgit v1.2.3