How To calculate/display large float numbers?

Jens Kallup jkallup at web.de
Sun Nov 27 04:50:57 UTC 2016


Hello,

the following Code gives me always 0 - why?
How can I say want = 12.30, and print the number?

TIA
Jens

#include <stdio.h>
#include <stdlib.h>
#include <printf.h>

#include "gmp.h"

int
main()
{
         mpq_t want;

         mpq_init(want);
         mpq_init_set_str(want,"12.30",10);
         mpq_out_str(stdout,10,want); printf("\n");
         mpq_clear(want);

         return 0;
}


More information about the gmp-discuss mailing list