Hello All,
After weeks of waiting I received a nice response from Technical support.
This is a way the Complex numbers handled by C32:
#include <stdio.h>
#include "p32xxxx.h"
#define COMPLEX _Complex
int main(argc, argv)
int argc;
char *argv[];
{
COMPLEX double z1, z2, z3, z4;
double creal(), cimag();
__C32_UART = 1;
z1 = 1 + 1i;
z2 = 1 - 1i;
z3 = z1*z2;
z4 = z3/z1;
printf("%g + %gi\n", creal(z4), cimag(z4));
return 0;
}
//----------------------------------------------------------------
This program demonstrates the use of complex numbers, as per the GNU C C30 manuals, and it works correctly on both C30 and C32. You can use either the __complex__ or _Complex keywords, both work the same.
The creal() and cimag() functions are normally defined in the C99 complex.h header file. Neither C30 nor C32 instalations include this header file, but declaring them manually in the program works.