forked from OSchip/llvm-project
[flang] Do not emit a bogus exponent (0.e-1)
Original-commit: flang-compiler/f18@3d0b13d7ed Reviewed-on: https://github.com/flang-compiler/f18/pull/736
This commit is contained in:
parent
722ffc3e2d
commit
f2917c777b
|
@ -487,9 +487,13 @@ std::ostream &Real<W, P, IM>::AsFortran(
|
|||
if (DEREF(p) == '-' || *p == '+') {
|
||||
o << *p++;
|
||||
}
|
||||
int expo{result.decimalExponent};
|
||||
if (*p != '0') {
|
||||
--expo;
|
||||
}
|
||||
o << *p << '.' << (p + 1);
|
||||
if (result.decimalExponent != 1) {
|
||||
o << 'e' << (result.decimalExponent - 1);
|
||||
if (expo != 0) {
|
||||
o << 'e' << expo;
|
||||
}
|
||||
o << '_' << kind;
|
||||
if (parenthesize) {
|
||||
|
|
Loading…
Reference in New Issue