q/tests/programs/align.q

26 lines
698 B
Plaintext

import math
main() {
assert math.align2(0) == 0
assert math.align2(1) == 1
assert math.align2(2) == 2
assert math.align2(3) == 4
assert math.align2(4) == 4
assert math.align2(5) == 8
assert math.align2(6) == 8
assert math.align2(7) == 8
assert math.align2(8) == 8
assert math.align2(9) == 16
assert math.align2(10) == 16
assert math.align2(30) == 32
assert math.align2(60) == 64
assert math.align2(100) == 128
assert math.align2(200) == 256
assert math.align2(500) == 512
assert math.align2(1000) == 1024
assert math.align2(2000) == 2048
assert math.align2(4000) == 4096
assert math.align2(8000) == 8192
assert math.align2(16000) == 16384
assert math.align2(32000) == 32768
}