Skip to content

Instantly share code, notes, and snippets.

@jbsilva
Created October 28, 2012 23:56
Show Gist options
  • Save jbsilva/3970517 to your computer and use it in GitHub Desktop.
Save jbsilva/3970517 to your computer and use it in GitHub Desktop.
/*
* Testanto a precisão do long double do C.
* Em Python: pow(math.e, math.pi) - math.pi = 19.99909997918947
*/
#include <math.h>
#include <stdio.h>
#define pi 3.14159265358979323846264338327L
#define e 2.718281828459045235360287471352L
int main()
{
printf("%Lf\n", pow(e, pi)-pi); /* 19.999100 */
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment