// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>

using namespace std;

#include <gmp.h>
#include <gmpxx.h>

mpf_class pow(mpf_class x, unsigned int n)
{
    mpf_t res;
    mpf_init(res);
    mpf_pow_ui(res, x.get_mpf_t(), n);
    mpf_class realres(res);
    mpf_clear(res);
    return realres;
}

int main()
{
    mpf_class two(2, 1000);
    cout << two << endl;
    cout << sqrt(two) << endl;
    cout << pow(two, 2) << endl;
    return 0;
}
