public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
* gsl_complex_pow_real(gsl_complex_rect(0,0),0) returns (0,0)
@ 2010-05-03 18:41 Rhys Ulerich
  2010-05-03 18:46 ` Rhys Ulerich
  2010-05-04 11:52 ` Brian Gough
  0 siblings, 2 replies; 5+ messages in thread
From: Rhys Ulerich @ 2010-05-03 18:41 UTC (permalink / raw)
  To: gsl-discuss

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-06  9:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-03 18:41 gsl_complex_pow_real(gsl_complex_rect(0,0),0) returns (0,0) Rhys Ulerich
2010-05-03 18:46 ` Rhys Ulerich
2010-05-04 11:52 ` Brian Gough
2010-05-06  4:06   ` Rhys Ulerich
     [not found]   ` <j2s4a00655d1005051949v110db7adzd8414490dfd31b0f@mail.gmail.com>
2010-05-06  9:03     ` Brian Gough

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).