[flang-commits] [PATCH] D128761: [flang][runtime] Emit "0.0E+0" for (1PG0.0) editing of 0.0

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Jun 29 11:43:04 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG53dca2e6ec6c: [flang][runtime] Emit "0.0E+0" for (1PG0.0) editing of 0.0 (authored by klausler).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128761/new/

https://reviews.llvm.org/D128761

Files:
  flang/runtime/edit-output.cpp


Index: flang/runtime/edit-output.cpp
===================================================================
--- flang/runtime/edit-output.cpp
+++ flang/runtime/edit-output.cpp
@@ -261,9 +261,10 @@
     flags |= decimal::AlwaysSign;
   }
   bool noLeadingSpaces{editWidth == 0};
+  int scale{edit.modes.scale}; // 'kP' value
   if (editWidth == 0) { // "the processor selects the field width"
     if (edit.digits.has_value()) { // E0.d
-      if (editDigits == 0) { // E0.0
+      if (editDigits == 0 && scale <= 0) { // E0.0
         significantDigits = 1;
       }
     } else { // E0
@@ -274,7 +275,6 @@
   }
   bool isEN{edit.variation == 'N'};
   bool isES{edit.variation == 'S'};
-  int scale{edit.modes.scale}; // 'kP' value
   int zeroesAfterPoint{0};
   if (isEN) {
     scale = IsZero() ? 1 : 3;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128761.441108.patch
Type: text/x-patch
Size: 803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220629/93256aee/attachment.bin>


More information about the flang-commits mailing list