From 130302ec19f786a842786961848f327e3cd8618c Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 3 Dec 2021 22:06:33 -0500 Subject: Add missed complex extension page --- docs/spec/complex.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 docs/spec/complex.html (limited to 'docs/spec/complex.html') diff --git a/docs/spec/complex.html b/docs/spec/complex.html new file mode 100644 index 00000000..a5d4826e --- /dev/null +++ b/docs/spec/complex.html @@ -0,0 +1,14 @@ + + + + BQN Specification: Complex numbers + + +

Specification: Complex numbers

+

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 )?
+
+

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