Using mpq_t for aggregating currencies with wildly varying ranges
Donovan Hide
donovanhide at gmail.com
Thu Apr 17 16:28:10 UTC 2014
Thank you, that helps a lot! I think I might just do some straightforward
concatenating rather than fancy printf trickery. I guess this is what
happens when you read too much StackOverflow :-)
Cheers,
Donovan.
On 17 April 2014 17:09, <tg at gmplib.org> wrote:
> Donovan Hide <donovanhide at gmail.com> writes:
>
> gmp_sprintf(result,"0.%0*s",m-len+1,a->buf);
>
> 0. 17
>
> and I get whitespace instead. Does this sounds like a gmp bug, or am I
> getting messed up with compiler versions or flags?
>
> No GMP bug.
>
> GMP deflects some of the actual printing to the corresponding libc
> printf function, and since zero padding for strings is not portable, you
> observe system-dependent behaviour.
>
>
> Torbjörn
>
More information about the gmp-discuss
mailing list