Do you know how to do this simple line of code without error using Boost::multiprecison ?
boost::multiprecision::cpp_int v, uMax, candidate;
//...
v += 6 * ceil((sqrt(uMax * uMax - candidate) - v) / 6);
Using MSVC there is an error for "sqrt" and it's possible to fix it with:
v += 6 * ceil((sqrt(static_cast<boost::multiprecision::cpp_int>(uMax * uMax - candidate)) - v) / 6);
Then there is an error for "ceil" and it's possible to fix it with:
namespace bmp = boost::multiprecision;
typedef bmp::number<bmp::cpp_dec_float<0>> float_bmp;
v += 6 * ceil(static_cast<float_bmp>((sqrt(static_cast<bmp::cpp_int>(uMax * uMax - candidate)) - v) / 6));
Then there is an error of "generic interconvertion" !?!
I think there should be a more elegant way to realize a so simple line of code, isn't it? Let me know if you have some ideas about it please.
Regards.
ceil(BF(18)/6)
is3
andceil(BF(18)/BF(6))
is4
. Could you help me again? – Cowles