You could use Scheme, it’s a nice Lisp-like language that has built-in support for complex numbers. Also, since in Scheme data is code, it is really easy to turn user input into executable code.
Chicken Scheme is a popular variant.
Other popular languages with built-in complex number support are:
- R: use
ias suffix for imaginary numbers.(1+2i)^2returns-3+4j. - Python: use
jas a suffix for imaginary numbers.(1+2j)**2returns(-3+4j). - Ruby: use the
Complexclass. - C: include
complex.hand useIas the imaginary unit. See also How to work with complex numbers in C?
1
solved complex numbers [closed]