mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-19 17:49:47 +08:00
4d85a6fea6
* libF77/*: Delete KR_headers cruft. * libI77/*: Likewise. * libU77/*: Likewise. From-SVN: r54132
19 lines
351 B
C
19 lines
351 B
C
#include "f2c.h"
|
|
|
|
#undef abs
|
|
#include <math.h>
|
|
extern double f__cabs(double,double);
|
|
void pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b)
|
|
{
|
|
double logr, logi, x, y;
|
|
|
|
logr = log( f__cabs(a->r, a->i) );
|
|
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);
|
|
}
|