| 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 | |
| 392 | struct Decimal128RealConversion |
nothing calls this directly
no test coverage detected