i — Imaginary unit.
The complex double scalar with real part zero and imaginary part one. A workspace variable named i shadows this constant; use 1i when a literal imaginary unit is required.
Syntax
value = i()Value and execution
Evaluating this bare constant produces a host scalar without arguments, allocation of array payloads, provider access, ambient services, or effects. Native and WASM consumers share the constant's static kind; runtime registration supplies its value. Constant lookup does not create a callable overload.
Example
Read the constant
value = iUsing i with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how i changes the result.
Run a small i example, explain the result, then change one input and compare the output.
FAQ
Does this constant select GPU residency?⌄
No. It is a host scalar that may be consumed or transferred by ordinary numeric operations.
Related Constants functions
Source you can read
Every RunMat function's source is public. Read exactly how i is executed, line by line, in Rust.
- View the source for i in Rust on GitHub
- Learn how the RunMat runtime works
- Found a bug? Open an issue with a minimal reproduction.
About RunMat
RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/license.
- RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
- Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.