Jump to my Home Page Send me a message Check out stuff on GitHub Check out my photography on Instagram Check out my profile on LinkedIn Check me out on Facebook

Example GMP Programs

Here you will find several examples of source code intended to illustrate some basic applications of GMP -- the GNU multi-precision arithmetic library. While mostly intended to illustrate some applications, this code might also be of use to someone learning how to use GMP. The makefile is here.


General LCG implementation with GMP.
Simple use of the random functions in the GMP.
GMP benchmark program (for integer divisibility tests). Finds a factor of a number.
Use a Wallis formula to compute Pi (very slowly)!
Compute the value of Pi with random numbers!
© 2009 Mitch Richling