[libc-commits] [PATCH] D129702: [libc] add rounding modes to printf float conv

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Jul 13 19:06:32 PDT 2022


lntue added inline comments.


================
Comment at: libc/test/src/stdio/sprintf_test.cpp:709
+  // systems.
+  __llvm_libc::fputil::set_round(FE_TONEAREST);
+
----------------
It is better to use `ForceRoundingMode` that was refactored in https://reviews.llvm.org/D129685.  You can do something like:
```
{
  ForceRoundingMode r(RoundingMode::Nearest);

  <tests>
}
```
without worrying about changing current / default rounding modes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129702



More information about the libc-commits mailing list