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