问题
I tried already GMP, MPFR. But I can't accomplish a simple division like below. BTW I have LLVM compiler in Xcode. I try to compile, run it to IOS Simulator.
mpf_t a;
mpf_init2 (a, 256);
mpf_set_d(a, 0.7);
mpf_t b; mpf_init2 (b, 256);
mpf_set_d(b, 1.0);
mpf_t l; mpf_init2 (l, 256);
gmp_printf ("%.*Ff \n", 5, a); --- 0.70000
gmp_printf ("%.*Ff \n", 5, b); --- 1.00000
mpf_div(l, a, b);
gmp_printf ("%.*Ff", 5, l); --- 0.52502
回答1:
Have you tried MPIR? OpenSSL also provides a big number library...
来源:https://stackoverflow.com/questions/11037165/which-library-should-i-use-on-osx-for-arbitrary-precision-arithmetic