Skip to content

Commit

Permalink
[libc][NFC] Adjust sinf and cosf around -infinity inputs.
Browse files Browse the repository at this point in the history
The current tests verify if the result of -infinity is a quiet NaN with
sign bit set. But, that need not be the case on all platforms. So, just
checking that the result is a quiet NaN and ignoring the sign bit is
good enough.
  • Loading branch information
Siva Chandra Reddy committed Jun 9, 2020
1 parent 7dd86c9 commit ef0ea87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libc/test/src/math/cosf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ TEST(CosfTest, SpecialNumbers) {
EXPECT_EQ(llvmlibc_errno, EDOM);

llvmlibc_errno = 0;
EXPECT_TRUE(isNegativeQuietNaN(
__llvm_libc::cosf(valueFromBits(BitPatterns::negInf))));
EXPECT_TRUE(
isQuietNaN(__llvm_libc::cosf(valueFromBits(BitPatterns::negInf))));
EXPECT_EQ(llvmlibc_errno, EDOM);
}

Expand Down
4 changes: 2 additions & 2 deletions libc/test/src/math/sinf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ TEST(SinfTest, SpecialNumbers) {
EXPECT_EQ(llvmlibc_errno, EDOM);

llvmlibc_errno = 0;
EXPECT_TRUE(isNegativeQuietNaN(
__llvm_libc::sinf(valueFromBits(BitPatterns::negInf))));
EXPECT_TRUE(
isQuietNaN(__llvm_libc::sinf(valueFromBits(BitPatterns::negInf))));
EXPECT_EQ(llvmlibc_errno, EDOM);
}

Expand Down

0 comments on commit ef0ea87

Please sign in to comment.