Imaginary
Imaginary (⌾
) is a monadic scalar function which multiplies the argument by the imaginary unit <source lang=apl inline>0J1</syntaxhighlight>, usually denoted or in traditional mathematics. This can be seen as a mapping from a real number to a pure imaginary number (a complex number with the real part of 0). It was added to J as <source lang=j inline>j.</syntaxhighlight> together with initial support for complex numbers, and was adopted in Extended Dyalog APL using the glyph <source lang=apl inline>⌾</syntaxhighlight> as a monadic counterpart of Complex. In other APL implementations that support complex numbers, Circular with the left argument of <source lang=apl inline>¯11</syntaxhighlight> has the same functionality as Imaginary.
Examples
Try it online!<source lang=apl>
⌾ 3 ¯4 6
0J3 0J¯4 0J6
</syntaxhighlight>
Imaginary is equivalent to Complex with the default left argument of 0.
Try it online!<source lang=apl>
0 ⌾ 3 ¯4 6
0J3 0J¯4 0J6
</syntaxhighlight>
See also
External links
Documentation
- J Dictionary, NuVoc