Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In 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.



C99 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

Source: 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: