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

Function Grisu2

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

Source from the content-addressed store, hash-verified

319 }
320
321 void Grisu2(double value, char* buffer, int32_t* length, int32_t* K)
322 {
323 const DiyFp v(value);
324 DiyFp w_m, w_p;
325 v.NormalizedBoundaries(&w_m, &w_p);
326
327 const DiyFp c_mk = GetCachedPower(w_p.e, K);
328 const DiyFp W = v.Normalize() * c_mk;
329 DiyFp Wp = w_p * c_mk;
330 DiyFp Wm = w_m * c_mk;
331 Wm.f++;
332 Wp.f--;
333 DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K);
334 }
335
336 int32_t WriteExponent(int32_t K, char* buffer)
337 {

Callers 1

toStringFunction · 0.85

Calls 4

GetCachedPowerFunction · 0.85
DigitGenFunction · 0.85
NormalizedBoundariesMethod · 0.80
NormalizeMethod · 0.80

Tested by

no test coverage detected