20 RAPIDJSON_DIAG_OFF(type-limits)
28 #define TEST_DTOA(d, a)\ 29 *dtoa(d, buffer) = '\0';\ 30 EXPECT_STREQ(a, buffer) 38 TEST_DTOA(0.123456789012,
"0.123456789012");
40 TEST_DTOA(-79.39773355813419,
"-79.39773355813419");
44 TEST_DTOA(1.234567890123456e30,
"1.234567890123456e30");
46 TEST_DTOA(2.225073858507201e-308,
"2.225073858507201e-308");
47 TEST_DTOA(2.2250738585072014e-308,
"2.2250738585072014e-308");
48 TEST_DTOA(1.7976931348623157e308,
"1.7976931348623157e308");
56 #define TEST_DTOA(m, d, a)\ 57 *dtoa(d, buffer, m) = '\0';\ 58 EXPECT_STREQ(a, buffer) 82 TEST_DTOA(3, 2.225073858507201e-308,
"0.0");
83 TEST_DTOA(3, 2.2250738585072014e-308,
"0.0");
84 TEST_DTOA(3, 1.7976931348623157e308,
"1.7976931348623157e308");
85 TEST_DTOA(5, -0.14000000000000001,
"-0.14");
86 TEST_DTOA(4, -0.14000000000000001,
"-0.14");
87 TEST_DTOA(3, -0.14000000000000001,
"-0.14");
88 TEST_DTOA(3, -0.10000000000000001,
"-0.1");
89 TEST_DTOA(2, -0.10000000000000001,
"-0.1");
90 TEST_DTOA(1, -0.10000000000000001,
"-0.1");
char * dtoa(double value, char *buffer, int maxDecimalPlaces=324)