Jean-Guillaume Dumas
Givaro Documentation Download Installation Examples Contacts
Jean-Guillaume Dumas

Using Givaro

Jean-Guillaume Dumas

There are many examples in $GIVARO_DIR/examples about e.g.:

Jean-Guillaume Dumas

Here is a simple one which returns a fermat number :

#include <iostream>
#include <math.h>
#include <givaro/givinteger.h>

Integer fermat(const short n) {
      unsigned long exponent;
      exponent = pow(2.0,double(n));
      return pow(Integer(2UL), exponent) + 1;
}

int main(int argc, char ** argv) {
        std::cerr << fermat( atoi(argv[1] ) ) << std::endl;
        return 0;
}

Jean-Guillaume Dumas
Last update: Tuesday, January 10th 2012
Givaro
Jean-Guillaume Dumas