[Cython] C99/C++ complex type support
Robert Bradshaw
robertwb at math.washington.edu
Mon Dec 29 22:50:22 CET 2008
On Dec 29, 2008, at 1:39 PM, Dag Sverre Seljebotn wrote:
> My opinion is that specifying exact bit lengths should be an
> orthogonal issue/feature to complex float types. Cython already
> uses the C type system, and making an exception for complex types
> seems inconsistent and harder to learn. So I vote for using the
> syntax "complex long double" and so on, and what the "long double"
> part means is up to the C compiler (like other types work).
Yes, I meant that we let the complex64/128 type coerce back and forth
between these, I certainly agree with you that one should define them
the same way as in C.
> Note that no matter what we do, "complex64" etc. should be made
> available as typedefs in numpy.pxd, making use of the bit-length-
> detection already in the numpy C headers.
>
> Dag Sverre Seljebotn
> -----Original Message-----
> From: Robert Kern <robert.kern at gmail.com>
> Date: Monday, Dec 29, 2008 10:07 pm
> Subject: Re: [Cython] C99/C++ complex type support
> To: cython-dev at codespeak.netReply-To: cython-dev at codespeak.net
>
> Robert Bradshaw wrote:
>> On Dec 29, 2008, at 12:45 PM, Lisandro Dalcin wrote:
>>
>>> On Mon, Dec 29, 2008 at 5:42 PM, Robert Kern
>>> <robert.kern at gmail.com> wrote:
>>>> You might want to follow numpy's lead and define complex64 (float
>>>> complex),
>>>> complex128 (double complex), etc.
>>>>
>>> I really like your idea... Let's see what other people think about
>>> this...
>>
>> Yes. Note that "double complex" typically means a complex with
>> double-
>> prec real and imaginary parts, not 128 bits.
>>
>> Right. numpy goes with the convention that the bit-width suffix is
>> the width of
>> the entire item, not the component real and imaginary parts for
>> the complex type.
>>
>> --
>> 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
>> Cython-dev at codespeak.net
>> http://codespeak.net/mailman/listinfo/cython-dev
>>
>
> _______________________________________________
> Cython-dev mailing list
> Cython-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/cython-dev
More information about the Cython-dev
mailing list