From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24649 invoked by alias); 3 May 2010 18:46:03 -0000 Received: (qmail 24639 invoked by uid 22791); 3 May 2010 18:46:02 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SARE_MSGID_LONG45,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-gy0-f169.google.com (HELO mail-gy0-f169.google.com) (209.85.160.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 03 May 2010 18:45:58 +0000 Received: by gyg4 with SMTP id 4so1864740gyg.0 for ; Mon, 03 May 2010 11:45:55 -0700 (PDT) Received: by 10.231.150.195 with SMTP id z3mr427083ibv.3.1272912351556; Mon, 03 May 2010 11:45:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.32.199 with HTTP; Mon, 3 May 2010 11:45:31 -0700 (PDT) In-Reply-To: References: From: Rhys Ulerich Date: Mon, 03 May 2010 18:46:00 -0000 Message-ID: Subject: Re: gsl_complex_pow_real(gsl_complex_rect(0,0),0) returns (0,0) To: gsl-discuss@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org X-SW-Source: 2010-q2/txt/msg00005.txt.bz2 One thing I forgot to justify-- I expect (1,0) as a result below based on similarity to gsl_sf_pow_int and the comments in pow_int.c stating that gsl_sf_pow_int returns 0.0^0 =3D 1.0 for continuity. Please disregard if the complaint is mathematically bogus with that justification. - Rhys On Mon, May 3, 2010 at 1:40 PM, Rhys Ulerich wrote: > Hi all, > > Using gsl_complex_pow_real to compute (0+0i)^0 incorrectly gives 0 as > the result. =A0Try running > > #include > #include > #include > > int main(int argc, char *argv[]) > { > =A0 =A0gsl_complex z =3D gsl_complex_pow_real(gsl_complex_rect(0,0), 0); > =A0 =A0printf("(%g,%g)\n", GSL_REAL(z), GSL_IMAG(z)); > } > > which will output (0,0). =A0I expect it to kick back (1,0). =A0The > 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. =A0Let me know if you'd like me to file a bug. > > - Rhys >