http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48511
--- Comment #7 from Thomas Henlich <thenlich at users dot sourceforge.net> 2011-04-27 14:11:10 UTC --- Gay's routines (http://www.netlib.org/fp/) can handle double, float, extended, quad; rounding directions may be specified. They can output a given number of digits (compatible to all Fortran formats where this is required), thus mimicking the "regular" printf behaviour; or find the shortest number of digits that round-trip to the same value (good for G0 editing). This should be worth a try.