RAPIDJSON_DIAG_OFF(effc++)
36 while(rest < wp_w && delta - rest >= ten_kappa &&
37(rest + ten_kappa < wp_w ||
38wp_w - rest > rest + ten_kappa - wp_w)) {
46 if(
n< 10)
return1;
47 if(
n< 100)
return2;
48 if(
n< 1000)
return3;
49 if(
n< 10000)
return4;
50 if(
n< 100000)
return5;
51 if(
n< 1000000)
return6;
52 if(
n< 10000000)
return7;
53 if(
n< 100000000)
return8;
61 static const uint32_tkPow10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 };
63 const DiyFpwp_w = Mp -
W;
72 case9: d = p1 / 100000000; p1 %= 100000000;
break;
73 case8: d = p1 / 10000000; p1 %= 10000000;
break;
74 case7: d = p1 / 1000000; p1 %= 1000000;
break;
75 case6: d = p1 / 100000; p1 %= 100000;
break;
76 case5: d = p1 / 10000; p1 %= 10000;
break;
77 case4: d = p1 / 1000; p1 %= 1000;
break;
78 case3: d = p1 / 100; p1 %= 100;
break;
79 case2: d = p1 / 10; p1 %= 10;
break;
80 case1: d = p1; p1 = 0;
break;
84 buffer[(*len)++] =
static_cast<char>(
'0'+
static_cast<char>(d));
98 chard =
static_cast<char>(p2 >> -one.e);
100 buffer[(*len)++] =
static_cast<char>(
'0'+ d);
119 DiyFpWp = w_p * c_mk;
120 DiyFpWm = w_m * c_mk;
133*
buffer++ =
static_cast<char>(
'0'+
static_cast<char>(K / 100));
145*
buffer++ =
static_cast<char>(
'0'+
static_cast<char>(K));
150 inline char*
Prettify(
char*
buffer,
intlength,
intk,
intmaxDecimalPlaces) {
151 const intkk = length + k;
153 if(0 <= k && kk <= 21) {
155 for(
int i= length;
i< kk;
i++)
161 else if(0 < kk && kk <= 21) {
165 if(0 > k + maxDecimalPlaces) {
168 for(
int i= kk + maxDecimalPlaces;
i> kk + 1;
i--)
174 return&
buffer[length + 1];
176 else if(-6 < kk && kk <= 0) {
178 const int offset= 2 - kk;
184 if(length - kk > maxDecimalPlaces) {
187 for(
int i= maxDecimalPlaces + 1;
i> 2;
i--)
195 else if(kk < -maxDecimalPlaces) {
202 else if(length == 1) {
211 buffer[length + 1] =
'e';
static const char * bounds[]
#define RAPIDJSON_ASSERT(x)
Assertion.
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
const char * GetDigitsLut()
char * dtoa(double value, char *buffer, int maxDecimalPlaces=324)
void DigitGen(const DiyFp &W, const DiyFp &Mp, uint64_t delta, char *buffer, int *len, int *K)
void Grisu2(double value, char *buffer, int *length, int *K)
char * Prettify(char *buffer, int length, int k, int maxDecimalPlaces)
DiyFp GetCachedPower(int e, int *K)
void GrisuRound(char *buffer, int len, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w)
int CountDecimalDigit32(uint32_t n)
char * WriteExponent(int K, char *buffer)
const GenericPointer< typename T::ValueType > T2 value
Int4 delta(size_t dimension_, const Int4 *score_)
void NormalizedBoundaries(DiyFp *minus, DiyFp *plus) const
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4