Storing and printing integer values greater than 2^64

后端 未结 5 438
粉色の甜心
粉色の甜心 2020-12-06 12:17

I am trying to write a program for finding mersenne prime numbers. Using the unsigned long long type I was able to determine the value of the 9th mersenne prime, which is (2

5条回答
  •  遥遥无期
    2020-12-06 12:49

    What all these people are basically saying is that the 64bit CPU will not be capable of adding those huge numbers with just an instruction but you rather need an algorithm that will be able to add those numbers. Such an algorithm would have to treat the 2 numbers in pieces.

    And the libraries they listed will allow you to do that, a good exercise would be to develop one yourself (just the algorithm/function to learn how it's done).

提交回复
热议问题