I need to print out high precision pow() to the console. For example 100-(0.5)^100 is 99.9999999999999999999999999999992111390947789881945882714347172137703267935648909769952297210693359375 according to wolfram alpha.
When I generate like this long double d = (double)std::pow(0.5, 100.0)
; I get a number in scientific notation. I have also tried using GMP but primality_probability prints out as 100. Any tips on generating and printing high precision pow like this?
mpf_t primality_probability;
mpf_init2 (primality_probability, 256);
mpf_set_d(primality_probability, 0.5);
mpf_pow_ui(primality_probability, primality_probability, repetitions);
mpf_ui_sub(primality_probability, 100, primality_probability);