Robert Bradshaw wrote:
> On May 14, 2009, at 2:06 AM, Stefan Behnel wrote:
> 
>> Robert Bradshaw wrote:
>>> I just pushed a series of patches to http://hg.cython.org/cython-
>>> devel/ for complex number support. See
>>>
>>> http://hg.cython.org/cython-devel/file/5c014b865386/tests/run/
>>> complex_numbers_T305.pyx .
>>>
>>> Despite being a rather large change, and shortly before a release, it
>>> belongs in -devel because this is one of the motivations to do a
>>> release so soon.
>> Does it (potentially) break any existing stuff or is it a plain new  
>> feature?
> 
> It's a plain new feature, though I did have to touch a lot of code.
> 
>> The latter would make it easy to say: "Sure, let's release it; if the
>> feature is broken in some way, there will be a fix release."

OK I've looked at it and it looks sweet! Buffer support added, it was a 
three line change :-) [1]

I haven't been giving it thorough testing, but as good as it looks I 
suggest that we just release it with an "experimental" note (and 
obviously check whether it breaks existing code in any way).

One thing I miss is the ability to extract real and imaginary parts. I 
assume we want to follow Python here?

cdef double complex r = 1 + 1j
print r.real, r.imag

Tell me if you start on that because it's now on my TODO-list (though I 
might very well not get time before the release).

[1]

I'm making the assumption that C99 complex will be exchangeable with

   struct { T real, imag}

both when it comes to alignment and ordering. Perhaps a runtime check 
for those assumptions should be added at some point.

Without C99 support those assumptions obviously holds anyway.

-- 
Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to