[libc-commits] [libc] [libc][math] implement `signbit` (PR #97791)

via libc-commits libc-commits at lists.llvm.org
Wed Jul 10 08:19:24 PDT 2024


================
@@ -0,0 +1,59 @@
+//===-- Utility class to test the signbit macro [f|l] -----------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_TEST_INCLUDE_MATH_SIGNBIT_H
+#define LLVM_LIBC_TEST_INCLUDE_MATH_SIGNBIT_H
+
+#include "test/UnitTest/FEnvSafeTest.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+
+#include "include/llvm-libc-macros/math-function-macros.h"
+
+#define PI 3.14159265358979323846
----------------
lntue wrote:

Just use `T(1)` or `T(-1)` in the test is enough, we don't need PI here.

https://github.com/llvm/llvm-project/pull/97791


More information about the libc-commits mailing list