I'm kind of a newbie with c++ so just a heads up there. I have added a third party arbitrary precision arithmetic library called "bigfloat" to my c++ project (https://github.com/Mariotti94/BigFloat) because I need some high precision when calculating pi with the chudnovsky algorithm as the factorials in the equation overflow very quickly but it seems that the variables associated with the third party library are not declared in cmath and therefore the program runs into some errors when I try to use the pow() function in the main equation.
sum += ((426880.0*sqrt(10005.0))/((firstifac)*((545140134.0*i)+(13591409.0)))/((secondifac)*
(pow(thirdifac,3.0))*pow(-262537412640768000.0,i)) );
// main equation
When I tried to run the program, it came up with the 4 following errors saying:
error: no matching function for call to 'pow(BigFloat&, int)'|
error: no type named '__type' in 'struct __gnu_cxx::__promote<BigFloat, false>'|
error: no matching function for call to 'pow(long long int, BigFloat&)'|
error: no type named '__type' in 'struct __gnu_cxx::__promote<BigFloat, false>'|
|
and because I'm a bit naïve when it comes to c++ I thought that in line 406 of the cmath library:
inline long double
pow(long double __x, int __n)
{ return __builtin_powil(__x, __n); }
I could just substitute "long double" for "BigFloat" but unsurprisingly, that didn't work and I'm unsure of how to establish the BigFloat variable in the pow() function. if anyone knows how to establish the variable or knows a more efficient way I would be very grateful.