Hey, I'm on Euler #3. I programmed the whole solution correctly, it displays prime factors of numbers accurately. The given number: 600851475143, however, is too big for c++ long int to handle. Any suggestions on what I should do?
Btw 4x AdWord C-C-Combo
You might need to have two long int variables, for instance, with a long int holding the most significant bits. When there is overflow you will need to 'bit shift' the calculation to retain those bit and store them in the most significant long int.
Google 'bit shifting' if you are unclear.
I use the GNU Multi-Precision library for a lot of those problems.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks