diff options
Diffstat (limited to 'man3/cacosh.3')
-rw-r--r-- | man3/cacosh.3 | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/man3/cacosh.3 b/man3/cacosh.3 index 979bad42a..b9624a4b0 100644 --- a/man3/cacosh.3 +++ b/man3/cacosh.3 @@ -62,30 +62,30 @@ glibc 2.1. .\" SRC BEGIN (cacosh.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; - +\& if (argc != 3) { fprintf(stderr, "Usage: %s <real> <imag>\en", argv[0]); exit(EXIT_FAILURE); } - +\& z = atof(argv[1]) + atof(argv[2]) * I; - +\& c = cacosh(z); printf("cacosh() = %6.3f %6.3f*i\en", creal(c), cimag(c)); - +\& f = 2 * clog(csqrt((z + 1)/2) + csqrt((z \- 1)/2)); printf("formula = %6.3f %6.3f*i\en", creal(f), cimag(f)); - +\& exit(EXIT_SUCCESS); } .EE |