summaryrefslogtreecommitdiffstats
path: root/man3/catan.3
diff options
context:
space:
mode:
Diffstat (limited to 'man3/catan.3')
-rw-r--r--man3/catan.314
1 files changed, 7 insertions, 7 deletions
diff --git a/man3/catan.3 b/man3/catan.3
index 3c0cc84da..4ba880226 100644
--- a/man3/catan.3
+++ b/man3/catan.3
@@ -59,31 +59,31 @@ C99, POSIX.1-2001.
.\" SRC BEGIN (catan.c)
.EX
/* Link with "\-lm" */
-
+\&
#include <complex.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-
+\&
int
main(int argc, char *argv[])
{
double complex z, c, f;
double complex i = I;
-
+\&
if (argc != 3) {
fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]);
exit(EXIT_FAILURE);
}
-
+\&
z = atof(argv[1]) + atof(argv[2]) * I;
-
+\&
c = catan(z);
printf("catan() = %6.3f %6.3f*i\en", creal(c), cimag(c));
-
+\&
f = (clog(1 + i * z) \- clog(1 \- i * z)) / (2 * i);
printf("formula = %6.3f %6.3f*i\en", creal(f), cimag(f));
-
+\&
exit(EXIT_SUCCESS);
}
.EE