MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / StrtodBigInteger

Function StrtodBigInteger

rapidjson/internal/strtod.h:206–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206inline double StrtodBigInteger(double approx, const char* decimals, size_t length, size_t decimalPosition, int exp) {
207 const BigInteger dInt(decimals, length);
208 const int dExp = static_cast<int>(decimalPosition) - static_cast<int>(length) + exp;
209 Double a(approx);
210 int cmp = CheckWithinHalfULP(a.Value(), dInt, dExp);
211 if (cmp < 0)
212 return a.Value(); // within half ULP
213 else if (cmp == 0) {
214 // Round towards even
215 if (a.Significand() & 1)
216 return a.NextPositiveDouble();
217 else
218 return a.Value();
219 }
220 else // adjustment
221 return a.NextPositiveDouble();
222}
223
224inline double StrtodFullPrecision(double d, int p, const char* decimals, size_t length, size_t decimalPosition, int exp) {
225 RAPIDJSON_ASSERT(d >= 0.0);

Callers 1

StrtodFullPrecisionFunction · 0.85

Calls 4

CheckWithinHalfULPFunction · 0.85
SignificandMethod · 0.80
NextPositiveDoubleMethod · 0.80
ValueMethod · 0.45

Tested by

no test coverage detected