How to use cacos() to computes complex arc cosine in C

1 Answer

0 votes
#include <stdio.h>
#include <math.h>
#include <complex.h>

int main(void)
{
    double complex n = cacos(-2);
    
    printf("cacos(-2+0i) = %f%+fi\n", creal(n), cimag(n));
    printf("cacos(-2+0i) = %f + i%f\n", creal(n), cimag(n));
   
    return 0;
}
  
/*
run:
 
cacos(-2+0i) = 3.141593-1.316958i
cacos(-2+0i) = 3.141593 + i-1.316958

*/

 



answered Aug 26, 2016 by avibootz

Related questions

2 answers 244 views
3 answers 135 views
135 views asked Jan 25, 2023 by avibootz
2 answers 251 views
1 answer 165 views
...