[all-commits] [llvm/llvm-project] fa465b: [flang][runtime] Improve confusing list-directed R...

Peter Klausler via All-commits all-commits at lists.llvm.org
Wed Apr 24 15:40:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fa465b479b09b638e95c8b92ecf358c38910f8b0
      https://github.com/llvm/llvm-project/commit/fa465b479b09b638e95c8b92ecf358c38910f8b0
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2024-04-24 (Wed, 24 Apr 2024)

  Changed paths:
    M flang/runtime/edit-output.cpp
    M flang/unittests/Runtime/NumericalFormatTest.cpp

  Log Message:
  -----------
  [flang][runtime] Improve confusing list-directed REAL(2) output (#89846)

List-directed output editing of REAL values will minimize the number of
digits that are emitted by calculating a decimal value that, if read
back in to a REAL variable of the same kind, would compare equal.

This behavior is causing some confusion when applied to list-directed
output of large REAL(2) values. Specifically, the value HUGE(0._2)
(which is 0x7bff in hex) is exactly 65504, but is edited to 65500. by
list-directed output, which selects F0 editing, minimizes the value to
6.55e4, and then formats it without the exponent.

This small patch changes that behavior for cases where the output of
digit-minimized F editing has no digits after the decimal point and
zeroes need to be emitted before it due to the decimal exponent. Digit
minimization is disabled in this case and the exact digits are emitted
instead.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list