Skip to content

Instantly share code, notes, and snippets.

@maidis
Created June 1, 2020 12:12
Show Gist options
  • Save maidis/df582f34f9f5519bc5b681fe580e69a6 to your computer and use it in GitHub Desktop.
Save maidis/df582f34f9f5519bc5b681fe580e69a6 to your computer and use it in GitHub Desktop.
gmpxx1.cpp
#include <iostream>
#include <gmpxx.h>
int main (void)
{
mpz_class a, b, c;
a = 1234;
b = "-5678";
c = a+b;
std::cout << "sum is " << c << "\n";
std::cout << "absolute value is " << abs(c) << "\n";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment