Before:
sprintf("%3.3f", Gmp.mpq(1,3));
(1) Result: "0.333"
sprintf("%3.3f", Gmp.mpq(2,3));
(2) Result: ".666"
Ok, I can see that seems a bit wrong.
After:
sprintf("%3.3f", Gmp.mpq(1,3));
(1) Result: "0.333"
sprintf("%3.3f", Gmp.mpq(2,3));
(2) Result: "066\0\0"
Uh, but that's not right either, is it?
Could we please make it a habit to test our code at least once before pushing it? K thx bye...
Marcus Comstedt (ACROSS) (Hail Ilpalazzo!) @ Pike (-) developers forum wrote:
sprintf("%3.3f", Gmp.mpq(1,3));
(1) Result: "0.333"
sprintf("%3.3f", Gmp.mpq(2,3));
(2) Result: ".666"
Ok, I can see that seems a bit wrong.
Could we please make it a habit to test our code at least once before pushing it? K thx bye...
I tested it, of course. But the circumstances where it goes wrong are elusive. The test I performed before committing it turned out to be flawed, which I noticed shortly thereafter when I performed more tests.
I now have a mildly better understanding of the problem, and am confident that the new fix is right, which is not to say that there might be a better fix, but for that one would need to understand a larger part of the code first.
pike-devel@lists.lysator.liu.se