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

Method ToRealPositive

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

Source from the content-addressed store, hash-verified

308
309 template <typename Real>
310 static Real ToRealPositive(const Decimal32& decimal, int32_t scale) {
311 if (scale <= 0 || uint64_t(decimal.value()) <= RealTraits<Real>::kMaxPreciseInteger) {
312 return ToRealPositiveNoSplit<Real>(decimal, scale);
313 }
314
315 Decimal32 whole_decimal, fraction_decimal;
316 decimal.GetWholeAndFraction(scale, &whole_decimal, &fraction_decimal);
317
318 Real whole = ToRealPositiveNoSplit<Real>(whole_decimal, 0);
319 Real fraction = ToRealPositiveNoSplit<Real>(fraction_decimal, scale);
320
321 return whole + fraction;
322 }
323};
324
325struct Decimal64RealConversion

Callers

nothing calls this directly

Calls 2

GetWholeAndFractionMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected