MCPcopy Create free account
hub / github.com/crownengine/crown / GetCachedPower

Function GetCachedPower

3rdparty/bx/src/dtoa.cpp:212–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210 };
211
212 DiyFp GetCachedPower(int32_t e, int32_t* K)
213 {
214 double dk = (-61 - e) * 0.30102999566398114 + 347; // dk must be positive, so can do ceiling in positive
215 int32_t k = static_cast<int32_t>(dk);
216 if (k != dk)
217 {
218 k++;
219 }
220
221 uint32_t index = static_cast<uint32_t>( (k >> 3) + 1);
222 *K = -(-348 + static_cast<int32_t>(index << 3) ); // decimal exponent no need lookup table
223
224 BX_ASSERT(index < sizeof(s_kCachedPowers_F) / sizeof(s_kCachedPowers_F[0]), "");
225 return DiyFp(s_kCachedPowers_F[index], s_kCachedPowers_E[index]);
226 }
227
228 void GrisuRound(char* buffer, int32_t len, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w)
229 {

Callers 1

Grisu2Function · 0.85

Calls 1

DiyFpClass · 0.85

Tested by

no test coverage detected