Lisandro Dalcin wrote: > On Wed, Oct 7, 2009 at 5:49 PM, Robert Bradshaw > <rober...@math.washington.edu> wrote: >> >> Actually, would defined(std::complex) work? >> > > Of course not ... The preprocessor knows nothing about C/C++ types ... > >> Really, I don't have a >> strong preference of how it works as long as it just works for the >> user, in both C and C++, whether or not the compiler supports it, and >> without having to specify extra directives. >> > > Well, I'm almost there... The patch is attached. Should I upload it to > Trac, and reopen ticket #305? > > For the case of C, C99 complexes will be automatically used ONLY if > _Complex_I is defined... of if the user explicitly pass > "-DPYX_CCOMPLEX=1" at C-compile time (or a Cython-included C header > #define PYX_CCOMPLEX=1), or if the directive "ccomplex=True". > > I'm still in doubt about how to handle 'ccomplex=True'... Should it > just enable by default using "#define PYX_CCOMPLEX=1", or actually > impact in code generation (as currently does)... > > Ah! I forgot... I do not know how to implement z.conjugate(); the > C/C99/C++ support is there though... BTW, GCC seems to accept "~z" for > complex conjugation (no idea if it is C99-standard or a > GCC-extension)... Perhaps Cython should accept this (non-Python) > syntax? I think it is nice. > > Conjugate in std::complex is spelled conj(z)
_______________________________________________ Cython-dev mailing list Cython-dev@codespeak.net http://codespeak.net/mailman/listinfo/cython-dev