https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119241
--- Comment #21 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I'm not sure if shifting the exponent is right for positive exponents, for very large ones that would mean appending zeros but the exact value might not have zeros in there, so we might need something with bigger precision from real_to_decimal. There is always the possibility to use mpfr_snprintf instead of real_to_decimal (at least for the %.*f case with precision).