From absd00t@c1186.ae.ge.com  Thu Sep 17 14:55:31 1998
From: absd00t@c1186.ae.ge.com (U-E59264-Osman F Buyukisik)
Date: Thu, 17 Sep 1998 09:55:31 -0400 (EDT)
Subject: R-beta: (0+0i)^2
In-Reply-To: <199809171256.OAA18599@sophie.ethz.ch>
References: <199809162211.KAA27407@chance.otago.ac.nz>
 <199809171256.OAA18599@sophie.ethz.ch>
Message-ID: <13825.5161.410293.721272@c1186.ae.ge.com>

I am not a "c" programmer but this is very simple and seems to be
working (just a check for 0): in src/main/complex.c 
...
static void complex_pow(complex *r, complex *a, complex *b)
{
    double logr, logi, x, y, mag;
    if ((mag = hypot(a->r, a->i)) == 0.0) {
        r->r = r->i = 0.0;
    }
    else {
    logr = log(mag );
    logi = atan2(a->i, a->r);
    x = exp( logr * b->r - logi * b->i );
    y = logr * b->i + logi * b->r;
    r->r = x * cos(y);
    r->i = x * sin(y);
    }
}
....
Osman
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


R-beta: (0+0i)^2
U-E59264-Osman F Buyukisik