(value *big.Int)
| 164 | } |
| 165 | |
| 166 | func canUseSmallDecimalEncoding(value *big.Int) bool { |
| 167 | if value == nil { |
| 168 | return true |
| 169 | } |
| 170 | if value.Cmp(decimalLongMin) < 0 || value.Cmp(decimalLongMax) > 0 { |
| 171 | return false |
| 172 | } |
| 173 | return (encodeDecimalZigZag64(value.Int64()) & (1 << 63)) == 0 |
| 174 | } |
| 175 | |
| 176 | func encodeDecimalZigZag64(value int64) uint64 { |
| 177 | return uint64((value << 1) ^ (value >> 63)) |
no test coverage detected