[flang] Minor fix to list-directed REAL output editing

Always emit the letter 'E' in list-directed REAL output;
the library was omitting it for exponents greater than 99,
as should be done for E and D formatting of large exponents
without an Ed exponent digit count.

Differential Revision: https://reviews.llvm.org/D93319
This commit is contained in:
peter klausler 2020-12-15 10:49:01 -08:00
parent 3aa8e071dd
commit b1afbceb92
1 changed files with 1 additions and 1 deletions

View File

@ -116,7 +116,7 @@ const char *RealOutputEditingBase::FormatExponent(
}
}
*--exponent = expo < 0 ? '-' : '+';
if (edit.expoDigits || exponent + 3 == eEnd) {
if (edit.expoDigits || edit.IsListDirected() || exponent + 3 == eEnd) {
*--exponent = edit.descriptor == 'D' ? 'D' : 'E'; // not 'G'
}
length = eEnd - exponent;