Skip to content

Instantly share code, notes, and snippets.

@iwillspeak
Last active December 15, 2015 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iwillspeak/5329918 to your computer and use it in GitHub Desktop.
Save iwillspeak/5329918 to your computer and use it in GitHub Desktop.
An example of computing R and Theta for a complex number in C99
#include <stdio.h>
#include <stdlib.h>
#include <complex.h>
int main(int argc, char* argv[])
{
float _Complex number = 1 + (1 * _Complex_I);
printf("%g, %g", cabs(number), carg(number));
exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment