'unsigned long long' can solve upto 15 digits.
Is there a way to find square-root of a 100 digit number?
You could also use Boost.Multiprecision library. This library provides wrappers for some popular multiprecision implementations.
#include <iostream>
#include <string>
#include <utility>
#include <boost/multiprecision/mpfr.hpp>
int main()
{
std::string s(100, '0');
s.at(0) = '1';
boost::multiprecision::mpfr_float_100 f(std::move(s));
boost::multiprecision::mpfr_float_100 sqrt = boost::multiprecision::sqrt(f);
std::cout << sqrt.str() << std::endl;
return 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With