[libc-commits] [libc] [libc][math] Implement `issignaling` and `iscanonical` macro. (PR #111403)
Shourya Goel via libc-commits
libc-commits at lists.llvm.org
Tue Oct 8 23:17:29 PDT 2024
================
@@ -11,6 +11,19 @@
#include "math-macros.h"
+#ifndef __cplusplus
+#define issignaling(x) \
+ _Generic((x), \
+ float: issignalingf, \
+ double: issignaling, \
+ long double: issignalingl)(x)
+#define iscanonical(x) \
+ _Generic((x), \
+ float: iscanonicalf, \
+ double: iscanonical, \
+ long double: iscanonicall)(x)
+#endif
----------------
Sh0g0-1758 wrote:
This macro is defined in C23 and while C++ does not have anything equivalent, it will most likely be `std::issignaling` as a template function. Also, the C++ header cmath in libc++ will most likely undef all the macro defs. So the tests in include should only test the function under C for now.
https://github.com/llvm/llvm-project/pull/111403
More information about the libc-commits
mailing list