[PATCH] D66836: [libc++] Add `__truncating_cast` for safely casting float types to integers

Steve Canon via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 28 08:59:39 PDT 2019


scanon added inline comments.


================
Comment at: test/libcxx/numerics/truncating_cast.pass.cpp:36
+      {static_cast<double>(Lim::max()) + 1, Lim::max(), false},
+      {static_cast<double>(Lim::max()) + 1024, Lim::max(), false},
+  };
----------------
Probably should test `nextafter(static_cast<double>(Lim::max()), INFINITY)` here instead.


Repository:
  rCXX libc++

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

https://reviews.llvm.org/D66836





More information about the cfe-commits mailing list