help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] complex numbers and zeta function


From: Jordi Gutiérrez Hermoso
Subject: Re: [Help-gsl] complex numbers and zeta function
Date: Sat, 21 Jun 2008 10:09:10 -0500

On 20/06/2008, Hongzheng Wang <address@hidden> wrote:
>  On Sat, Jun 21, 2008 at 1:53 AM, Jordi Gutiérrez Hermoso
>  <address@hidden> wrote:
>
>  > Thank you. One comment: you used C complexes, which don't work in C++.
>  > Funny, did you know that C and C++ have mutually incompatible
>  > implementations of complex numbers, at least with gcc?
>
>
> Could you please give us more detailed info about his issue?  Do you
>  mean they are using difference memory layout?  Or just syntax
>  difference (C's complex is a macro for built-in keyword _Complex,
>  while C++'s complex is a template class). I think it would be of
>  benefit to us even beyond the scope of gsl.  Thank you in advance.

Syntax seems to be it. They have widely different syntax. There may
also be implementation issues. The macro, unless C's complexes are not
as standard as I think they are, is "complex", not "_Complex". The
biggest problem, and maybe there is a way to override it, is that
#include<complex.h> gets interpreted different ways depending if gcc
is compiling the code as a C or a C++ program. As a C program, it
includes the right declaration, and as a C++ program, it interprets it
as an attempt to write #include <complex> and warns about deprecated
headers.

HTH,
- Jordi G. H.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]