A complex number is a number that has a real part and an imaginary part, for example:
2 + 3i
A new type of expression for complex numbers containing 2 number expressions needs to be created, as well as updating every operator to be able to handle complex numbers. I hope D's magic templates can do this in a pretty way somehow.
As for how to handle user input complex numbers, the following syntax should be supported:
{3 - 7i}2 + 3i
In the first case, a new complex number expressions containing the values (3, -7) will be created.
In the second case, the 3i will be translated as {0 + 3i}.
Add support for complex numbers.
A complex number is a number that has a real part and an imaginary part, for example:
2 + 3i
A new type of expression for complex numbers containing 2 number expressions needs to be created, as well as updating every operator to be able to handle complex numbers. I hope D's magic templates can do this in a pretty way somehow.
As for how to handle user input complex numbers, the following syntax should be supported:
{3 - 7i}
2 + 3i
In the first case, a new complex number expressions containing the values (3, -7) will be created. In the second case, the
3i
will be translated as{0 + 3i}
.