Decimal represents a fixed-precision decimal value up to DECIMAL(38, s). The unscaled value is stored as a little-endian i128 split into two int64 halves: Lo (low 64 bits, unsigned interpretation) and Hi (high 64 bits, sign-extended). For values that fit in int64, use [NewDecimal]. Usage: paimon
| 137 | // paimon.NewDecimal(12345, 10, 2) // 123.45 as DECIMAL(10,2) |
| 138 | // paimon.Decimal{Lo: lo, Hi: hi, ...} // full i128 |
| 139 | type Decimal struct { |
| 140 | Lo int64 // low 64 bits of unscaled i128 (unsigned interpretation) |
| 141 | Hi int64 // high 64 bits of unscaled i128 (sign extension) |
| 142 | Precision uint32 |
| 143 | Scale uint32 |
| 144 | } |
| 145 | |
| 146 | // NewDecimal creates a Decimal from an int64 unscaled value. |
| 147 | // For unscaled values that exceed int64 range, construct Decimal directly |
no outgoing calls