cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ] #include <mathcw.h> #include <cxcw.h> extern float cxargf (cx_float z); extern double cxarg (cx_double z); extern long double cxargl (cx_long double z); extern __float80 cxargw (cx___float80 z); extern __float128 cxargq (cx___float128 z); extern long_long_double cxargll (cx_long_long_double z); extern decimal_float cxargdf (cx_decimal_float z); extern decimal_double cxargd (cx_decimal_double z); extern decimal_long_double cxargdl (cx_decimal_long_double z); extern decimal_long_long_double cxargdll (cx_decimal_long_long_double z);
NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.
If the argument in Cartesian form is z = x + y I, where x and y are real, then in polar form, z = r exp(t I), where r = |z| = cabs(z) = hypot(x, y) and t = carg(z) = atan2(y, x).
The cx family of functions provide limited support for complex arithmetic when compiler or language support for a complex type is lacking.