[all-commits] [llvm/llvm-project] 39c2f5: [flang][runtime] Fix NEAREST() when exponent decre...

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue Dec 26 15:28:49 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 39c2f59709f454f04cc13151301ca19c4ba9c152
      https://github.com/llvm/llvm-project/commit/39c2f59709f454f04cc13151301ca19c4ba9c152
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2023-12-26 (Tue, 26 Dec 2023)

  Changed paths:
    M flang/runtime/numeric.cpp
    M flang/unittests/Runtime/Numeric.cpp

  Log Message:
  -----------
  [flang][runtime] Fix NEAREST() when exponent decreases (#75368)

When the result of NEAREST() has an exponent less than that of the
argument (e.g., NEAREST(1.,-1.) and NEAREST(-1.,1.)), the result was
wrong, because the increment value uses the result of SPACING() in terms
of the argument. Fix by just calling into the C runtime routine
std::nextafter().




More information about the All-commits mailing list