mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 16:50:27 +00:00
On development genome skim tools
This commit is contained in:
@@ -94,11 +94,14 @@ func (u Uint64) LeftShift64(n uint, carryIn uint64) (value, carry uint64) {
|
||||
|
||||
case n == 64:
|
||||
return carryIn, u.w0
|
||||
|
||||
case n < 128:
|
||||
return carryIn, u.w0 << (n - 64)
|
||||
|
||||
}
|
||||
|
||||
log.Warnf("Uint64 overflow at LeftShift64(%v, %v)", u, n)
|
||||
return 0, 0
|
||||
|
||||
}
|
||||
|
||||
// RightShift64 performs a right shift operation on the Uint64 value by n bits, with carry-out to carry.
|
||||
@@ -117,10 +120,13 @@ func (u Uint64) RightShift64(n uint, carryIn uint64) (value, carry uint64) {
|
||||
return u.w0, 0
|
||||
|
||||
case n < 64:
|
||||
return u.w0>>n | (carryIn & ^((1 << (64 - n)) - 1)), u.w0 << (n - 64)
|
||||
return u.w0>>n | (carryIn & ^((1 << (64 - n)) - 1)), u.w0 << (64 - n)
|
||||
|
||||
case n == 64:
|
||||
return carryIn, u.w0
|
||||
|
||||
case n < 128:
|
||||
return carryIn, u.w0 >> (n - 64)
|
||||
}
|
||||
|
||||
log.Warnf("Uint64 overflow at RightShift64(%v, %v)", u, n)
|
||||
|
||||
Reference in New Issue
Block a user