Skip to content

Instantly share code, notes, and snippets.

@maidis
Created June 1, 2020 12:42
Show Gist options
  • Save maidis/13dd67ffcbce31a9ec7e6b1200b22940 to your computer and use it in GitHub Desktop.
Save maidis/13dd67ffcbce31a9ec7e6b1200b22940 to your computer and use it in GitHub Desktop.
gmpxx2.cpp
#include <iostream>
#include <gmpxx.h>
int main (void)
{
mpz_class a, b, c;
b = 12;
c = 5;
mpz_gcd (a.get_mpz_t(), b.get_mpz_t(), c.get_mpz_t());
std::cout << "GCD of " << b << " and " << c << " is " << a << ".\n";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment