complex numbers on P2 ?
I would have liked to calculate with complex numbers on the P2.
riscvp2 has implemented <complex.h> and I've already done some experiments with it.
Unfortunately there is no full support for the P2 and I don't have the knowledge to expand this compiler.
With flexc and catalina I can't find any header files in the direction of <complex.h> either.
I have now started to calculate with double complex, whatever double means on the respective compiler.
I named the namespace _complex to avoid conflicts with a possible later version.
It is a kind of macro language, but I think it is quite comfortable.
I've made a few demos that compile with both flexspin and gcc on Linux.
RLC ... calculate the frequency response of a RLC Circuit and show it on an Osci.
unity_circle ... show the unity circle on Oszi in XY - mode.
genpi ... a demo that uses complex numbers, as opposed to the usual arithmetic with separate real and imaginary parts.
and my numeric_testbench for basic tests.
I will continue to expand the applications.
For example, I have an Inverse Laplace Transform in mind that already runs reasonably well on the PC.