aboutsummaryrefslogtreecommitdiff
path: root/docs/spec/complex.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/spec/complex.html')
-rw-r--r--docs/spec/complex.html2
1 files changed, 1 insertions, 1 deletions
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 @@
<p>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.</p>
<p>A <em>complex number</em> is a value with two <em>components</em>, a <em>real part</em> and an <em>imaginary part</em>. The type of each component is a real number, as described in the <a href="types.html">type</a> specification. However, this type replaces the number type given there.</p>
<p>The <a href="literal.html">numeric literal</a> notation is extended with the character <code><span class='Value'>i</span></code>, which separates two real-valued components (in effect, it has lower &quot;precedence&quot; than other characters like <code><span class='Value'>e</span></code> and <code><span class='Number'>¯</span></code>). If a second component is present (using <code><span class='Value'>i</span></code> or <code><span class='Function'>I</span></code>), that component's value is multiplied by the <a href="https://en.wikipedia.org/wiki/Imaginary_unit">imaginary unit</a> <em>i</em> 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.</p>
-<pre><span class='Value'>complexnumber</span> <span class='Function'>=</span> <span class='Value'>number</span> <span class='Paren'>(</span> <span class='Paren'>(</span> <span class='String'>&quot;i&quot;</span> <span class='Function'>|</span> <span class='String'>&quot;I&quot;</span> <span class='Paren'>)</span> <span class='Value'>number</span> <span class='Paren'>)</span><span class='Value'>?</span>
+<pre><span class='Value'>complexnumber</span> <span class='Function'>=</span> <span class='Value'>number</span> <span class='Paren'>(</span> <span class='Paren'>(</span> <span class='String'>&quot;i&quot;</span> <span class='Function'>|</span> <span class='String'>&quot;I&quot;</span> <span class='Paren'>)</span> <span class='Value'>number</span> <span class='Paren'>)</span><span class='Head'>?</span>
</pre>
<p>Basic arithmetic functions <code><span class='Function'>+-×÷</span></code> are extended to complex numbers. A monadic case for the function <code><span class='Function'>+</span></code> is added, which returns the conjugate argument: a number with real part equal to the real part of <code><span class='Value'>𝕩</span></code> and imaginary part negated relative to <code><span class='Value'>𝕩</span></code>.</p>
<p>The primitive function <code><span class='Value'>⍳</span></code> is added: the character <code><span class='Value'>⍳</span></code> forms a primitive function <a href="token.html">token</a>, and its value is the function <code><span class='Brace'>{</span><span class='Value'>𝕨</span><span class='Function'>⊢</span><span class='Modifier2'>⊘</span><span class='Function'>+</span><span class='Number'>0j1</span><span class='Function'>×</span><span class='Value'>𝕩</span><span class='Brace'>}</span></code>. This function multiplies <code><span class='Value'>𝕩</span></code> by <em>i</em>, then adds <code><span class='Value'>𝕨</span></code> if given.</p>