| 261 | |
| 262 | template <typename Real> |
| 263 | static Real ToReal(const DecimalType& decimal, int32_t scale) { |
| 264 | DCHECK_GE(scale, -kMaxScale); |
| 265 | DCHECK_LE(scale, kMaxScale); |
| 266 | if (decimal.IsNegative()) { |
| 267 | // Convert the absolute value to avoid precision loss |
| 268 | auto abs = decimal; |
| 269 | abs.Negate(); |
| 270 | return -Derived::template ToRealPositive<Real>(abs, scale); |
| 271 | } else { |
| 272 | return Derived::template ToRealPositive<Real>(decimal, scale); |
| 273 | } |
| 274 | } |
| 275 | }; |
| 276 | |
| 277 | struct Decimal32RealConversion |
nothing calls this directly
no test coverage detected