Fri, 29 Apr 2011 16:59:22 +0200, mark florisson wrote: [clip] > Hmm, indeed, it's pretty weird. I'm fine with the pairing also, although > I'm still not sure how common this case is, and if we really want to > support it. Wouldn't good old C promotion work for this? e.g. if the > type is either float or double, just declare your variable double?
In practice mostly yes I guess; IIRC single-precision arithmetic is not any faster than double precision nowadays anyway. However, (playing the devil's advocate :) (i) Theoretically, someone might also want to write code that works both for "double" and for "long double complex". You probably wouldn't want to use "long double" for the double-precision specialization. (ii) One reason to use floats could be the 2x size advantage. In principle someone might want to deal with huge float and float complex arrays. (Sounds like a somewhat rare use case though.) (iii) If you want to wrap a library that already provides complex float functions in both precisions, having a specialized real type could come handy sometimes. But in practice, I guess the "fused_type(double, double complex)" would be the most common use case. Maybe it's best to wait until enough concrete examples accumulate before implementing anything more --- I guess e.g. the pairing feature wouldn't be too difficult to add if it turns out something like that is really needed. Pauli _______________________________________________ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel