Using mpq_t for aggregating currencies with wildly varying ranges

tg at gmplib.org tg at gmplib.org
Thu Apr 17 16:09:42 UTC 2014


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