1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

math: fix bits_test

This commit is contained in:
Alexey
2020-04-09 13:43:37 +03:00
committed by GitHub
parent 3fbf91a044
commit 384d401af0
3 changed files with 3 additions and 5 deletions

View File

@ -236,11 +236,10 @@ fn test_bits(){
// 32 bit
i = 1
for x in 0..32 {
v0 := (u32(i) << x)
v0 := u32(i) << x
v1 := v0 - 1
hi, lo := mul_32(v0, v1)
//C.printf("x:%08x [%llu,%llu] %llu\n", v0, hi, lo, u64(v0 * v1))
assert (u64(hi) << 32) | (u64(lo)) == u64(v0 * v1)
assert (u64(hi) << 32) | (u64(lo)) == u64(v0) * u64(v1)
}
// 64 bit