/* 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 <stdio.h>

#include <gmp.h>

int main()
{
    mpf_t two, sqrttwo, powtwo;
    mpf_set_default_prec(1000);
    mpf_init_set_si(two, 2);
    gmp_printf("%.72Ff\n", two);
    mpf_init(sqrttwo);
    mpf_sqrt(sqrttwo, two);
    gmp_printf("%.72Ff\n", sqrttwo);
    mpf_init(powtwo);
    mpf_pow_ui(powtwo, two, 2);
    gmp_printf("%.72Ff\n", powtwo);
    mpf_clear(two);
    mpf_clear(sqrttwo);
    mpf_clear(powtwo);
    return 0;
}
