3 ms·
Are you comparing C's built in complex type with a C++ library or a C++ library with a C library?
by panzi 12y ago
Are you comparing C's built in complex type with a C++ library or a C++ library with a C library?
- neutronicus 12y agoIn both cases it's libraries defined by their respective standards, I think. The important thing is that the C++ class overloads operators and mathematical functions, and the C class doesn't.
- panzi 12y agoC99 has a builtin complex type. "double complex" (similar to "unsigned int"). Of course all arithmetic operators are defined for that type. Example: http://coliru.stacked-crooked.com/view?id=0d295064bd367eca http://coliru.stacked-crooked.com/view?id=0d295064bd367eca Source: http://en.cppreference.com/w/c/numeric/complex http://en.cppreference.com/w/c/numeric/complex Have you tried that? Of course Microsoft refuses to implement C99, so you could only try it on non-Microsoft C implementations.