forked from OSchip/llvm-project
Print the sign of negative infinity
Differential Revision: https://reviews.llvm.org/D111917
This commit is contained in:
parent
4cd6dc5adb
commit
9eb71608ee
|
@ -168,7 +168,7 @@ void llvm::write_double(raw_ostream &S, double N, FloatStyle Style,
|
|||
S << "nan";
|
||||
return;
|
||||
} else if (std::isinf(N)) {
|
||||
S << "INF";
|
||||
S << (std::signbit(N) ? "-INF" : "INF");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -125,6 +125,8 @@ TEST(NativeFormatTest, BoundaryTests) {
|
|||
FloatStyle::Fixed));
|
||||
EXPECT_EQ("INF", format_number(std::numeric_limits<double>::infinity(),
|
||||
FloatStyle::Fixed));
|
||||
EXPECT_EQ("-INF", format_number(-std::numeric_limits<double>::infinity(),
|
||||
FloatStyle::Fixed));
|
||||
}
|
||||
|
||||
TEST(NativeFormatTest, HexTests) {
|
||||
|
|
Loading…
Reference in New Issue