[libc-commits] [libc] [libc][math][c23] Add {ldexp, scalbn, scalbln}f16 C23 math functions (PR #94797)
via libc-commits
libc-commits at lists.llvm.org
Mon Jun 10 06:21:01 PDT 2024
================
@@ -183,6 +184,10 @@ template <size_t Bits> struct DyadicFloat {
return r;
}
+ LIBC_INLINE explicit constexpr operator float16() const {
+ return static_cast<float16>(static_cast<float>(*this));
+ }
----------------
lntue wrote:
Congratulations, you have found examples of double-rounding errors! Once `DyadicFloat` can support `uint16_t` base type, the current `operator T()` implementation should work correctly.
https://github.com/llvm/llvm-project/pull/94797
More information about the libc-commits
mailing list