Imaginary

Imaginary literals are numeric literals followed immediately by one of the characters that represents the imaginary constant i (defined as the square root of -1).

Valid characters are: i I j J. There must be no space between the numeric literal and the i. A lone i is also a valid imaginary literal.

Examples of valid imaginary literals:

  • i
  • 3.3i
  • 3.3j
  • 5.0E2I
  • 6.23J

Examples of invalid imaginary literals:

  • 2 i (must be no space between the numeric literal and the i)
  • i3 (the numeric literal must precede the i)