Complex numbers based on libtomfloat
All elementary functions as defined by Mathematica(TM), that is
- Addition
- Subtraction
- Multiplication
- Division
- Square root (all two branches)
- Logarithm (all branches)
- Power (all branches)
- Exponentiation base
e - Sine and relatives (sin, sinh, asin, asinh)
- Cosine and relatives (cos, cosh, acos, acosh)
- Tangent and relatives (tan, tanh, atan, atanh, atan2)
- Lambert-W function (also known as ProductLog)
- Norm
- Argument
- Magnitude (absolute value)
- Phase
- Negation
- Conjugate
- Multiplicative inverse
- Conversion: cartesian to polar representation and vice versa
- Isolate real part
- Isolate imaginary part
- …
Some functions may get added but mostly in the "helpers" department.
The comparing function, not listed above, is a bit special. It is not possible
to compare two complex values, so two complex numbers get compared first
for full equality (a.re == b.re && a.im == b.im) then
their magnitudes get collated and finally their phase angels.
Yes, it is costly.
MIT, because the lobbying billionaires successfully bribed the lawmakers in such a way that they made laws that de facto forbid me to put anything into public domain because I cannot guarantee that it stays there.