summaryrefslogtreecommitdiff
path: root/contrib/libf2c/libF77/c_log.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libf2c/libF77/c_log.c')
-rw-r--r--contrib/libf2c/libF77/c_log.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/contrib/libf2c/libF77/c_log.c b/contrib/libf2c/libF77/c_log.c
index 24d1a3c957b43..6715131ad1db3 100644
--- a/contrib/libf2c/libF77/c_log.c
+++ b/contrib/libf2c/libF77/c_log.c
@@ -2,16 +2,20 @@
#ifdef KR_headers
extern double log(), f__cabs(), atan2();
-VOID c_log(r, z) complex *r, *z;
+VOID c_log(resx, z) complex *resx, *z;
#else
#undef abs
-#include "math.h"
+#include <math.h>
extern double f__cabs(double, double);
-void c_log(complex *r, complex *z)
+void c_log(complex *resx, complex *z)
#endif
{
- double zi, zr;
- r->i = atan2(zi = z->i, zr = z->r);
- r->r = log( f__cabs(zr, zi) );
- }
+complex 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;
+}