Skip to content

complex

a number with a real and an imaginary part

1
# a number then i
2
3 + 4i
Example outputCtrl+Enter to run
1
# arithmetic works as usual
2
(1 + 2i) * (3 - 1i)5 + 5i
Example outputCtrl+Enter to run
  • sqrt square root
  • abs the value without its sign, so -3 becomes 3
  • exp e (2.718…) to the power x
  • ln natural logarithm, the log base e
  • re the real part
  • im the imaginary part, as a plain number
  • conj the complex conjugate: the same number with its imaginary part negated
  • arg the angle from the positive real axis to the number, as an angle unit
  • csqrt square root that gives a complex number for negatives, so csqrt(-4) is 2i
  • croots all n complex nth roots of a number, as a list
  • polar make a complex number from its polar form, or with one argument show z in that form

Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.