Skip to content

Instantly share code, notes, and snippets.

@milktrader
Created March 20, 2012 00:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milktrader/2129199 to your computer and use it in GitHub Desktop.
Save milktrader/2129199 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <gmp.h>
/* On Linux, compile like so: g++ sq.cpp -lgmp -lgmpxx */
using namespace std;
int main() {
mpz_t b;
mpz_init (b);
mpz_set_ui (b, 456);
mpz_t p;
mpz_init (p);
mpz_pow_ui(p, b, 456);
cout<<p;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment