Known bugs in MPFR 0.4
mpfr_cmp(b, c) fails when b=0 and 0 < c < 1.
A simple workaround is to replace in file cmp.c the line
if (!NOTZERO(b) && !NOTZERO(c)) { return 0; }
by the following lines:
if (!NOTZERO(b)) {
if (!NOTZERO(c)) return 0; else return -(SIGN(c));
}
else if (!NOTZERO(c)) return SIGN(b);
mpfr_out_str gives a wrong result for a power-of-two base
and rounding away from zero. A workaround is to add in file get_str.c
the line:
mpfr_round(b, rnd_mode, EXP(b));
after the line
ok = mpfr_can_round(b, EXP(b)-sh-1, rnd_mode, rnd_mode, n*pow2);