On 06/03/2011 05:51 AM, jerry DeLisle wrote: > Hi, > > The attached patch, which includes test cases, fixes this bug by eliminating the > code which used floating point instructions to determine the 'r' value as > outlined in the Fortran standard under G formatting. > > Essentially, the code now examines the d and e values to determine the number of > digits before and after the decimal point and whether or not to display the 'E' > exponent symbol. Adjustments are made for various corner cases, including when > rounding has resulted in a carry. (see PR for details of the trials) > > This patch is intrusive. It results in a minor performance improvement. It > eliminates a bit of code. > > Regression tested on x86-64. > > OK for trunk? then later back port to 4.6 after some proving time? Attached is updated patch based on comments from Thomas Henlich. See my comment #33 and subsequent comments in the PR48906 explaining the issue with test case fmt_g0_6.f08 which is revised by the updated patch. Regression tested on X86-64. OK for trunk. (please ;) ) Jerry