[libc-commits] [libc] [libc][math][c23] Add {frexp, ilogb, ldexp, llogb, logb, modf}f16 C23 math functions (PR #94758)
via libc-commits
libc-commits at lists.llvm.org
Fri Jun 7 07:27:39 PDT 2024
- Previous message: [libc-commits] [libc] [libc][math][c23] Add {frexp, ilogb, ldexp, llogb, logb, modf}f16 C23 math functions (PR #94758)
- Next message: [libc-commits] [libc] [libc][math][c23] Add {frexp, ilogb, ldexp, llogb, logb, modf}f16 C23 math functions (PR #94758)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
================
@@ -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));
+ }
----------------
overmighty wrote:
The smoke test for `ldexpf16` showed that `operator T()` defined above did not always give correct results for `float16`. At least this part did not: https://github.com/llvm/llvm-project/blob/main/libc/src/__support/FPUtil/dyadic_float.h#L160-L161.
Maybe we could have an exhaustive test for `ldexpf16`.
https://github.com/llvm/llvm-project/pull/94758
- Previous message: [libc-commits] [libc] [libc][math][c23] Add {frexp, ilogb, ldexp, llogb, logb, modf}f16 C23 math functions (PR #94758)
- Next message: [libc-commits] [libc] [libc][math][c23] Add {frexp, ilogb, ldexp, llogb, logb, modf}f16 C23 math functions (PR #94758)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the libc-commits
mailing list