Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,104 questions

40,777 answers

573 users

How to use acos() to compute the complex base-e exponential of complex n in C

Learn & Practice SQL


86 views
asked Aug 27, 2016 by avibootz
edited Aug 27, 2016 by avibootz

1 Answer

0 votes
#include <stdio.h>
#include <math.h>
#include <complex.h>
 
int main(void)
{
    double PI = acos(-1);
    double complex n = cexp(I * PI); 
    
    printf("exp(i*pi) = %.1f%+.1fi\n", creal(n), cimag(n));
 
    return 0;
}
  
/*
run:
 
exp(i*pi) = -1.0+0.0i

*/

 





answered Aug 27, 2016 by avibootz
...