Using mpq_t for aggregating currencies with wildly varying ranges

Donovan Hide donovanhide at gmail.com
Wed Apr 16 22:22:47 UTC 2014


I've had a lot of success with this project and am very grateful for
everyone's help. One strange bug I've encountered is a difference in output
from this line which deals with values less than one:

gmp_sprintf(result,"0.%0*s",m-len+1,a->buf);

on OS X with gmp 6.0.0a I get the expected zero padding:

0.0000000000000000000000000017

but on ubuntu saucy with libgmp-dev 2:5.1.2+dfsg-2ubuntu1 the variable
length zero padding doesn't appear:

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?

Cheers,
Donovan.


More information about the gmp-discuss mailing list