bad mpq_get_d results on PowerPC Linux

Kevin Ryde user42 at
Wed Feb 11 09:38:11 CET 2004

Atro Tossavainen <atossava at> writes:
> ERROR (test 612/0): bad mpq_get_d results
> last: 3.315352422524752e-24
>        new: -1.454567013152684e-11
>       -113026234172476979752832757723304149684674808611255934304418911451560681441/7770438429474596887962807826402114814514286497955999302324375258580805648128969670656
> FAIL: t-get_d

On further examination, this looks like it's gone badly wrong
somewhere.  I think the "last" value there should be about the same
-1.454567013152684e-11 as the "new" on that test 612.

The diagnostics from that program aren't especially clear, so you
might like to put in a few more.  The test data used is the same on
any 32-bit system, so you can compare the output from a good system
with what you're seeing.

The test program, for what it's worth, starts with a fraction "a" and
successively adds values "eps", expecting that mpq_get_d will give a
non-decreasing sequence of values.  The test data is generated
randomly, but there's no seeding by default so it's the same on each
run.  You can put a bit of code to wait for iteration 612 and pick out
the data the seems to be going wrong.

All followups to gmp-bugs at please.

More information about the gmp-bugs mailing list