gmp_printf output

Sisyphus sisyphus1 at optusnet.com.au
Thu Oct 19 13:24:20 CEST 2006


----- Original Message ----- 
From: "piix" <piix at gmx.net>
.
.
>
> mich% ./size
> value: 0.810000000000000039968
> value: 0.656100000000000064748
> value: 0.430467210000000084963
> value: 0.185302018885184173147
> value: 0.0343368382029251519552
> value: 0.0011790184577738601788
> value: 0.00000139008452377145171749
> value: 0.00000000000193233498322890371505
> value: 0.00000000000000000000000373391848741024760171
> value:
> 0.0000000000000000000000000000000000000000000000139421472706240313777
>
> Although i got no errors while 'make check' these results are clearly
> wrong. Has somebody the same problem or a solution,
>

Ummm ... I get the same as you ... but I don't see the results as being
"clearly wrong".
Could you elaborate ? (Sometimes my vision is not all that great :-)

Perhaps you need to 'printf("%d\n", mpf_get_default_prec());' to see the
default precision that is actually being used.

If you want to set the precision to 16 bits you probably need to use mpfr
instead.

Cheers,
Rob



More information about the gmp-discuss mailing list