"ComplexNumber" (Interpreter Type)
Complex number in a standard format.
Details
- "ComplexNumber" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "ComplexNumber" does not require connectivity to the Wolfram Cloud.
Allowed Forms
- The real and imaginary parts can be in the number formats allowed by "Number".
Restriction Specifications
-
Restricted["ComplexNumber",{{choice1,…}}] one among choices Restricted["ComplexNumber",region] a complex number within a region of the complex plane Restricted["ComplexNumber",Automatic,n] a complex number with n-digit precision
Options
- The following options can be used for the real and imaginary parts:
-
DigitBlock Infinity number of digits between breaks NumberPoint "." decimal point string NumberSeparator {",",""} string to insert at breaks between blocks NumberSigns {"-",""} strings to use for signs of negative and positive numbers
Interpretation
- "ComplexNumber" yields a Complex.
Examples
Basic Examples (5)
Interpreter["ComplexNumber"]["3I"]Interpreter["ComplexNumber"]["-.5i+4"]Use the options to customize the number format:
Interpreter["ComplexNumber", NumberSigns -> {"n", "p"}]["nI p15"]Interpreter["ComplexNumber", NumberSeparator -> "#"]["10#000i"]Interpreter["ComplexNumber", NumberPoint -> ","]["1+7,3i"]Restrict the result to the unit circle:
Interpreter[Restricted["ComplexNumber", Circle[]]][" -i"]Interpreter[Restricted["ComplexNumber", Circle[]]]["1 - i"]Restrict the result to any region of the complex plane:
Interpreter[Restricted["ComplexNumber", ImplicitRegion[x^2 + y^2 ≤ 1, {x, y}]]][" -i"]Interpreter[Restricted["ComplexNumber", InfiniteLine[{0, 0}, {1, -1}]]][".4 - i .4"]Interpreter[Restricted["ComplexNumber", Automatic, 3]]["1.23456i+4.56789"]Otherwise, $MachinePrecision is implied:
Interpreter["ComplexNumber"]["1.23456i"]//PrecisionRelated Guides
History
Introduced in 2014 (10.0)