This is the mail archive of the gsl-discuss@sourceware.org mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gsl_complex_pow_real(gsl_complex_rect(0,0),0) returns (0,0)


Hi all,

Using gsl_complex_pow_real to compute (0+0i)^0 incorrectly gives 0 as
the result.  Try running

#include <stdio.h>
#include <gsl/gsl_complex.h>
#include <gsl/gsl_complex_math.h>

int main(int argc, char *argv[])
{
    gsl_complex z = gsl_complex_pow_real(gsl_complex_rect(0,0), 0);
    printf("(%g,%g)\n", GSL_REAL(z), GSL_IMAG(z));
}

which will output (0,0).  I expect it to kick back (1,0).  The
behavior for (1+0i)^0 and (0+1i)^0 looks correct.

Observed on GSL 1.14 with Intel 10.1 20090817 on Ubuntu 9.10 32bit.
Also on GSL 1.13 with Intel 10.1 20081024 on Ubuntu 8.04 64bit.
Also on GSL 1.12 with GCC 4.3.3 on Ubuntu 8.04 64bit.

I've not seen any references to this on the mailing list or in
savannah.  Let me know if you'd like me to file a bug.

- Rhys


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]