[libc-commits] [PATCH] D117590: [libc] Implement correct rounding with all rounding modes for hypot functions.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Jan 19 11:03:26 PST 2022


lntue added inline comments.


================
Comment at: libc/test/src/math/HypotTest.h:66
+          ASSERT_MPFR_MATCH_ALL_ROUNDING(mpfr::Operation::Hypot, input,
+                                         func(x, y), 0.5);
         }
----------------
sivachandra wrote:
> Is the call to `func` happening with the intended rounding mode?
Yes, by putting the call inside the macro, it will be put by the macro after the rounding mode is set before it is evaluated.  If it does not work as intended, the assertions with different rounding modes will definitely catch it,  because most of the outputs are not representable in the floating point, and hence rounding up/down will guarantee to give different results.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117590



More information about the libc-commits mailing list