No, I was reffering to the GMP, but yes, I can say for sure that this is a buggy code of mine. Couldn't get a really good approach and the last thing I tried was something like this:

However, I did face the same fact as anduril:Code:double test_dig(double a) {// LOG (Phi^1000/√5) double phi = 1.618033; double sqrt_5 = 2.2360679775; //return (a*phi - (0.34948500216)); std::cout << pow(phi, a) << std::endl; return log10(pow(phi, a)/sqrt_5); } int main() { double aa = 1000; std::cout << "1 = " << test_dig(aa) << std::endl; std::cout <<"2 = " << test_dig(2) << std::endl; std::cout <<"3 = " << test_dig(3) << std::endl; std::cout <<"5 = " << test_dig(5) << std::endl; std::cout <<"8 = " << test_dig(8) << std::endl; std::cout <<"13 = " << test_dig(13) << std::endl; aa = 21; std::cout << aa << " = " << test_dig(aa) << std::endl; aa = 34; return 0; }

""Tuning" it to be more accurate would be fun if I had the time, but probably also goes beyond my current math skills (which have degraded significantly since I finished school)."