Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When dealing with numbers of such magnitude, how are they stored in memory?


Even naively 2^257885161-1 can be represented with 257885161 bits, or 30MB.


I'm not sure how GIMPS does it, but if you're interested in how it CAN be done you could look into the GMP library for C.


It's definitely just a standard lots-of-bits. Every bit of information is needed, lose one and the whole test will be wrong. For current wavefront exponents, like 2^60,000,000-1, save files are around 8 MB, or ~60M bits -- exactly what you'd expect.

Also Prime95 doesn't use GMP, its code is all hand-coded assembly, optimized specifically for the LL test and x86 architecture, written by one very dedicated George Woltman.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: