mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-25 19:50:05 +00:00
Test signbit.
This commit is contained in:
parent
34b5030239
commit
5b054ae7b8
@ -49,6 +49,7 @@ FILE *FOpen(const char *filename, const char *mode) {
|
||||
#include "util.h"
|
||||
#include "gtest-extra.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#undef min
|
||||
@ -1232,6 +1233,7 @@ TEST(FormatterTest, FormatNaN) {
|
||||
double nan = std::numeric_limits<double>::quiet_NaN();
|
||||
EXPECT_EQ("nan", str(Format("{}") << nan));
|
||||
EXPECT_EQ("+nan", str(Format("{:+}") << nan));
|
||||
EXPECT_EQ(1, signbit(-nan));
|
||||
EXPECT_EQ("-nan", str(Format("{}") << -nan));
|
||||
EXPECT_EQ(" nan", str(Format("{: }") << nan));
|
||||
EXPECT_EQ("NAN", str(Format("{:F}") << nan));
|
||||
|
Loading…
Reference in New Issue
Block a user