Givaro | Documentation | Download | Installation | Examples | Contacts |
There are many examples in $GIVARO_DIR/examples about e.g.:
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; } |
Last update: Tuesday, January 10th 2012 | Givaro |