MCPcopy Create free account
hub / github.com/apache/arrow / ToRealPositive

Method ToRealPositive

cpp/src/arrow/util/decimal.cc:377–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375
376 template <typename Real>
377 static Real ToRealPositive(const Decimal64& decimal, int32_t scale) {
378 if (scale <= 0 || uint64_t(decimal.value()) <= RealTraits<Real>::kMaxPreciseInteger) {
379 return ToRealPositiveNoSplit<Real>(decimal, scale);
380 }
381
382 Decimal64 whole_decimal, fraction_decimal;
383 decimal.GetWholeAndFraction(scale, &whole_decimal, &fraction_decimal);
384
385 Real whole = ToRealPositiveNoSplit<Real>(whole_decimal, 0);
386 Real fraction = ToRealPositiveNoSplit<Real>(fraction_decimal, scale);
387
388 return whole + fraction;
389 }
390};
391
392struct Decimal128RealConversion

Callers

nothing calls this directly

Calls 2

GetWholeAndFractionMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected