/*
 Vorlesung Rechner-Arithmetik im Sommersemester 2002
 kleines Test-Beispiel in C++ zu der MPFR-Bibliothek

 Compilation:
 g++ -Wall -c -I/usr/local/arithmetic/include u3-bsp.cc
 g++ -Wall -o u3-bsp -L/usr/local/arithmetic/lib u3-bsp.o -lmpfr -lgmp
*/

#include <stdio.h>
#include <stdlib.h>
#include <gmp.h>
#include <mpfr.h>

int main(int argc, char *argv[])
{
  int prec=100;

  mpfr_t x, z;

  mpfr_init2(x, prec);
  mpfr_init2(z, prec);

  mpfr_set_d(x, 3.0, GMP_RNDN);
  mpfr_log  (z, x,   GMP_RNDN);

  mpfr_out_str (stdout, 10, 100, x, GMP_RNDN);
  printf("\n");
  mpfr_out_str (stdout, 10, 100, z, GMP_RNDN);
  printf("\n");
}
