q/lib/math/math.q

11 lines
136 B
Plaintext

align2(x uint64) -> uint64 {
x -= 1
x |= x >> 1
x |= x >> 2
x |= x >> 4
x |= x >> 8
x |= x >> 16
x |= x >> 32
x += 1
return x
}