[all-commits] [llvm/llvm-project] f08969: [flang][runtime] Better real MOD/MODULO results (#...

Peter Klausler via All-commits all-commits at lists.llvm.org
Mon Jan 15 11:48:48 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f0896911570eae97507f9e3ccf2732182404981e
      https://github.com/llvm/llvm-project/commit/f0896911570eae97507f9e3ccf2732182404981e
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2024-01-15 (Mon, 15 Jan 2024)

  Changed paths:
    M flang/docs/Extensions.md
    M flang/include/flang/Evaluate/real.h
    M flang/lib/Evaluate/real.cpp
    M flang/runtime/numeric.cpp
    M flang/test/Evaluate/fold-mod.f90

  Log Message:
  -----------
  [flang][runtime] Better real MOD/MODULO results (#77167)

The Fortran standard defines real MOD and MODULO with expressions like
MOD(a,p) = a - AINT(a/p)*p. Unfortunately, these definitions have poor
accuracy when a is much larger in magnitude than p, and every Fortran
compiler uses better algorithms instead.

Fixes llvm-test-suite/Fortran/gfortran/regression/mod_large_1.f90.




More information about the All-commits mailing list