1 //===-- Unittests for pow -------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "src/math/pow.h"
10 #include "test/UnitTest/FPMatcher.h"
11 #include "test/UnitTest/Test.h"
12 #include "utils/MPFRWrapper/MPFRUtils.h"
18 using FPBits
= __llvm_libc::fputil::FPBits
<double>;
20 namespace mpfr
= __llvm_libc::testing::mpfr
;
22 DECLARE_SPECIAL_CONSTANTS(double)
24 TEST(LlvmLibcAsinTest
, SpecialNumbers
) {
27 EXPECT_FP_EQ(aNaN
, __llvm_libc::pow(aNaN
, aNaN
));
30 EXPECT_FP_EQ(1.0, __llvm_libc::pow(1.0, 1.0));
33 EXPECT_FP_EQ(1.0, __llvm_libc::pow(1.0, 2.0));
36 EXPECT_FP_EQ(inf
, __llvm_libc::pow(2.0, inf
));