[libc-commits] [libc] [libc][math] Implement fpclassify macro. (PR #109519)
Shourya Goel via libc-commits
libc-commits at lists.llvm.org
Sat Sep 21 08:40:24 PDT 2024
================
@@ -0,0 +1,25 @@
+//===-- Unittests for fpclassify macro ------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDSList-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#include "include/llvm-libc-macros/math-function-macros.h"
+
+#include <assert.h>
+
+// check if macro is defined
+#ifndef fpclassify
+#error "fpclassify macro is not defined"
+#else
+int main(void) {
+ assert(fpclassify(1.819f) == 4);
----------------
Sh0g0-1758 wrote:
done.
https://github.com/llvm/llvm-project/pull/109519
More information about the libc-commits
mailing list