Search code examples
c++gmp

Are there any advantages to GMP over MPIR?


Both seem to be decent bignum libraries but I am not sure what the pros/cons of each are. I know this is a broad question but I am mostly after the prominent differences.


Solution

  • MPIR began as a fork of GMP so they share much code. The most obvious difference is that MPIR can be compiled by MS Visual Studio with optimized assembly language support. The latest MPIR release (2.6.0) includes a new FFT multiplication algorithm that is faster than GMP 5.0 (for the sizes I tested, YMMV). On the other hand, GMP is available on almost all Linux distributions.