MCPcopy Create free account
hub / github.com/RoaringBitmap/roaring / negativeTwosComplementToInt

Function negativeTwosComplementToInt

roaring64/bsi64.go:209–216  ·  view source on GitHub ↗
(val *big.Int)

Source from the content-addressed store, hash-verified

207}
208
209func negativeTwosComplementToInt(val *big.Int) *big.Int {
210 inverted := new(big.Int).Not(val)
211 mask := new(big.Int).Lsh(big.NewInt(1), uint(val.BitLen()))
212 inverted.And(inverted, mask.Sub(mask, big.NewInt(1)))
213 inverted.Add(inverted, big.NewInt(1))
214 val.Neg(inverted)
215 return val
216}
217
218type action func(t *task, batch []uint64, resultsChan chan *Bitmap, wg *sync.WaitGroup)
219

Callers 2

GetBigValueMethod · 0.85
minOrMaxMethod · 0.85

Calls 3

NotMethod · 0.80
AndMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…