+ 5
Big Integer in C++
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'; }
3 Réponses
+ 10
I 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
+ 9
the boost library is indeed useful for many things
+ 6
If anyone is wondering.
https://www.boost.org/