[libc-commits] [libc] [libc][math][c23] adds `nanf128` (PR #85201)

via libc-commits libc-commits at lists.llvm.org
Thu Mar 14 10:08:36 PDT 2024


================
@@ -0,0 +1,64 @@
+//===-- Unittests for nanf128 ---------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/UInt128.h"
+#include "src/math/nanf128.h"
+#include "test/UnitTest/FPMatcher.h"
+#include "test/UnitTest/Test.h"
+
+class LlvmLibcNanf128Test : public LIBC_NAMESPACE::testing::Test {
+public:
+  using FPBits128 = LIBC_NAMESPACE::fputil::FPBits<float128>;
+  using StorageType = FPBits128::StorageType;
+
+  const UInt128 QUIET_NAN =
+      FPBits128::quiet_nan(LIBC_NAMESPACE::fputil::Sign::POS, 0).uintval();
----------------
lntue wrote:

This is using all the default arguments, so you can shorten it to `FPBits128::quiet_nan().uintval()`

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


More information about the libc-commits mailing list