diff options
Diffstat (limited to 'contrib/libf2c/libF77/z_log.c')
-rw-r--r-- | contrib/libf2c/libF77/z_log.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/contrib/libf2c/libF77/z_log.c b/contrib/libf2c/libF77/z_log.c index 34c56d42a8c49..48afca63d6d65 100644 --- a/contrib/libf2c/libF77/z_log.c +++ b/contrib/libf2c/libF77/z_log.c @@ -2,15 +2,19 @@ #ifdef KR_headers double log(), f__cabs(), atan2(); -VOID z_log(r, z) doublecomplex *r, *z; +VOID z_log(resx, z) doublecomplex *resx, *z; #else #undef abs -#include "math.h" +#include <math.h> extern double f__cabs(double, double); -void z_log(doublecomplex *r, doublecomplex *z) +void z_log(doublecomplex *resx, doublecomplex *z) #endif { - double zi = z->i, zr = z->r; - r->i = atan2(zi, zr); - r->r = log( f__cabs( zr, zi ) ); - } +doublecomplex res; + +res.i = atan2(z->i, z->r); +res.r = log( f__cabs( z->r, z->i ) ); + +resx->r = res.r; +resx->i = res.i; +} |