24#if defined(_M_IX86) || defined(_M_ARM)
25#define RYU_32_BIT_PLATFORM
29static inline uint32_t decimalLength9(
const uint32_t v) {
34 assert(v < 1000000000);
35 if (v >= 100000000) {
return 9; }
36 if (v >= 10000000) {
return 8; }
37 if (v >= 1000000) {
return 7; }
38 if (v >= 100000) {
return 6; }
39 if (v >= 10000) {
return 5; }
40 if (v >= 1000) {
return 4; }
41 if (v >= 100) {
return 3; }
42 if (v >= 10) {
return 2; }
47static inline int32_t pow5bits(
const int32_t e) {
53 return (int32_t) (((((uint32_t) e) * 1217359) >> 19) + 1);
57static inline int32_t ceil_log2pow5(
const int32_t e) {
62static inline uint32_t log10Pow2(
const int32_t e) {
66 return (((uint32_t) e) * 78913) >> 18;
70static inline uint32_t log10Pow5(
const int32_t e) {
74 return (((uint32_t) e) * 732923) >> 20;
77static inline int copy_special_str(
char *
const result,
const bool sign,
const bool exponent,
const bool mantissa) {
79 memcpy(result,
"NaN", 3);
87 memcpy(result + sign,
"Infinity", 8);
90 memcpy(result,
"0", 1);
94static inline uint32_t float_to_bits(
const float f) {
96 memcpy(&bits, &f,
sizeof(
float));
100static inline uint64_t double_to_bits(
const double d) {
102 memcpy(&bits, &d,
sizeof(
double));