How can I multiply really big numbers c++

前端 未结 9 1670
梦谈多话
梦谈多话 2021-01-18 10:09

I have the following code

      int i, a, z;
i = 2343243443;
a = 5464354324324324;
z = i * a;
cout << z << endl;

When these are

9条回答
  •  后悔当初
    2021-01-18 11:03

    The result overflows the int (and also std::uint64_t)

    You have to use some BigInt library.

提交回复
热议问题