So I have a programming assignment in which I have to work with 64 digit numbers. I am currently using the boost::multiprecision::cpp_int library but I'm not able to use it on large numbers.
For example-
#include <boost/multiprecision/cpp_int.hpp>
int main()
{
boost::multiprecision::cpp_int n1 =123341257612045876129038576124390847381295732;
}
This is giving the error that the code is too long. After experimentation, it seems like cpp_int (supposed to contain as large a number as you want) is acting like an unsigned long long (shown in the picture above), how do I solve this?
Use the string constructor, because you cannot express the initializer in C++, otherwise.
Live On Coliru
Prints
Which is ~2.31 × 10^176