Commit Graph

1 Commits

Author SHA1 Message Date
Louis Dionne
34d1dd71fa [libc++] Add __truncating_cast for safely casting float types to integers
This is needed anytime we need to clamp an arbitrary floating point
value to an integer type.

Thanks to Eric Fiselier for the patch.

Differential Revision: https://reviews.llvm.org/D66836

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@370891 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit c9ac8d533010d8915bcfdecab891fb451f71ce74)
(cherry picked from commit 4561f55204960c0b3bc4594089ddcf56e5655cad)

Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=994957
Bug: http://b/139690488
Change-Id: I300b6565137b51bb3051bb629ec3316edf7f71e9
2019-09-13 18:07:13 -07:00