There is no translation included because... I just can't believe it. You just run fbfrog on the .h and it generated the corresponding .bi without any TODOs. It's too easy so I'm really not sure if the translated headers really correct or not.
There is an example here I took from their github page above. If you could translate it to FreeBASIC then please check if the headers translated by fbfrog really work. I personally know nothing about this kind of arbitrary precision math library so I can't test it myself. I have no idea what the code is doing.
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include "imath.h"
int main(int argc, char *argv[])
{
mpz_t a, b;
char *buf;
int len;
if(argc < 2) {
fprintf(stderr, "Usage: testprogram <integer>\n");
return 1;
}
/* Initialize a new zero-valued mpz_t structure */
mp_int_init(&a);
/* Initialize a new mpz_t with a small integer value */
mp_int_init_value(&b, 25101);
/* Read a string value in the specified radix */
mp_int_read_string(&a, 10, argv[1]);
/* Multiply the two together... */
mp_int_mul(&a, &b, &a);
/* Print out the result */
len = mp_int_string_len(&a, 10);
buf = calloc(len, sizeof(*buf));
mp_int_to_string(&a, 10, buf, len);
printf("result = %s\n", buf);
free(buf);
/* Release memory occupied by mpz_t structures when finished */
mp_int_clear(&b);
mp_int_clear(&a);
return 0;
}