ndex="-1"></a><span class="dt">complex</span> z = -<span class="fl">1.1</span> + <span class="fl">2.3i</span>;</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<p>produces the complex number <span class="math inline">\(-1.1 + 2.3i\)</span>. This only works if the real and imaginary components are literal numerals. To construct a complex number out of arbitrary real variables, the <code>to_complex()</code> function may be used. For example, the f