20RAPIDJSON_DIAG_OFF(type-limits)
23using namespace rapidjson::internal;
31 enum { kBufferSize = 11 };
32 enum { kMaxDigit = 10 };
38 enum { kBufferSize = 12 };
39 enum { kMaxDigit = 10 };
45 enum { kBufferSize = 21 };
46 enum { kMaxDigit = 20 };
52 enum { kBufferSize = 22 };
53 enum { kMaxDigit = 20 };
58static void VerifyValue(
T value,
void(*
f)(
T,
char*),
char* (*g)(
T,
char*)) {
63 *g(
value, buffer2) =
'\0';
70static void Verify(
void(*
f)(
T,
char*),
char* (*g)(
T,
char*)) {
72 VerifyValue<T>(0,
f, g);
73 VerifyValue<T>((std::numeric_limits<T>::min)(),
f, g);
74 VerifyValue<T>((std::numeric_limits<T>::max)(),
f, g);
80 VerifyValue<T>(i - 1,
f, g);
81 VerifyValue<T>(i,
f, g);
82 if ((std::numeric_limits<T>::min)() < 0) {
87 if (i >
static_cast<T>((std::numeric_limits<T>::max)() /
static_cast<T>(power)))
89 i *=
static_cast<T>(
power);
98 *
p++ =
static_cast<char>(char(
value % 10) +
'0');
115 u32toa_naive(u, buffer);
122 *
p++ =
static_cast<char>(char(
value % 10) +
'0');
139 u64toa_naive(u, buffer);
143 Verify(u32toa_naive, u32toa);
147 Verify(i32toa_naive, i32toa);
151 Verify(u64toa_naive, u64toa);
155 Verify(i64toa_naive, i64toa);
#define EXPECT_STREQ(s1, s2)
#define TEST(test_case_name, test_name)
T power(const T &x, const S &y)
#define T(meth, val, expected)
unsigned __int64 uint64_t
static int32_t Negate(int32_t x)
static int64_t Negate(int64_t x)
static uint32_t Negate(uint32_t x)
static uint64_t Negate(uint64_t x)