Lisandro Dalcin wrote: > I have some working code. If any of you have some time, I can send a > preliminary patch. > > There are a lot of issues that need to be addressed, mainly: > > * This new complex support should be enabled by using a complier > directive. If not, there are backward compatibility issues, now > 'complex' means the native C99/C++ type, and not the Python type > object. Furthermore, what would happen if the C compiler does not > fully implement C99 (Sun?). Other way will be to also support an > implementation based on Python's "Py_complex" struct, but I have not > idea how to transform airthmetic operations in appropriate function > calls. > > * Regarding the above issue, I'm not sure if we should use "complex" > or something new, like "ccomplex", I mean, how to specify the C native > type, like "cdef complex z" or "cdef ccomplex z", or something > different. The second will clearly help to dissambiguate and also > solve backward compatibility issues. > > * Up to now, I'm only managing the "double complex" case, supporting > "float complex" or "long double complex" will require the introduction > of a 'precission' concept in the spirit of 'longness' for integers > (What do you think?).
You might want to follow numpy's lead and define complex64 (float complex), complex128 (double complex), etc. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
