[libc-commits] [libc] [libc][math][c23] add c23 floating point fmaximum and fminimum functions. (PR #86016)
Job Henandez Lara via libc-commits
libc-commits at lists.llvm.org
Sun Mar 24 20:59:01 PDT 2024
================
@@ -0,0 +1,100 @@
+//===-- Utility class to test fminimum_num[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_SRC_MATH_SMOKE_FMINIMUMNUMTEST_H
+#define LLVM_LIBC_TEST_SRC_MATH_SMOKE_FMINIMUMNUMTEST_H
+
+#include "src/__support/FPUtil/FPBits.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+
+template <typename T>
+class FMinimumNumTest : public LIBC_NAMESPACE::testing::Test {
+
+ DECLARE_SPECIAL_CONSTANTS(T)
+
+public:
+ typedef T (*FMinimumNumFunc)(T, T);
+
+ void testNaN(FMinimumNumFunc func) {
+ EXPECT_FP_EQ(inf, func(FPBits::quiet_nan().get_val(), inf));
+ EXPECT_FP_EQ(inf, func(FPBits::signaling_nan().get_val(), inf));
----------------
Jobhdez wrote:
aNaN corresponds to quiet nans and sNaN corresponds to signaling nan right?
https://github.com/llvm/llvm-project/pull/86016
More information about the libc-commits
mailing list