Created
July 17, 2017 17:58
-
-
Save simonbyrne/0bb647059202d990c60d13d22db68a6d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <gmp.h> | |
#include <mpfr.h> | |
int main (void) | |
{ | |
unsigned int i; | |
mpfr_t u; | |
mpfr_init2(u, 7000000); | |
mpfr_const_pi(u, MPFR_RNDN); | |
mpfr_div_d (u, u, 6.0, MPFR_RNDN); | |
mpfr_sin (u, u, MPFR_RNDN); | |
mpfr_sub_d (u, u, 0.5, MPFR_RNDN); | |
printf ("Diff is "); | |
mpfr_out_str (stdout, 10, 50, u, MPFR_RNDN); | |
putchar ('\n'); | |
mpfr_clear (u); | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment