Look what I found! No more hastle of calculation of factorials of numbers > 100. #include <boost/multiprecision/cpp_int.hpp> #include <iostream> namespace mp = boost::multiprecision; using namespace std; int main() { mp::cpp_int u = 1; for(int i = 1; i <= 100; i++) u *= i; cout << "100! = " << u << '\n'; mp::cpp_int v = u / 100; cout << "99! = " << v << '\n'; }
1/10/2018 2:21:42 AM
Aditya3 Answers
New AnswerI found this in a pdf a while back which you may find interesting. (link to pdf in code). BigInt with native cpp/STL Boost library is better though imo. The pdf this is from is just a case study. https://code.sololearn.com/c0U2BqoJSrO1/?ref=app
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message