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.

Containers

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