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

remove u8 and i32 from tests and examples

This commit is contained in:
Alexander Medvednikov
2019-09-02 15:02:25 +03:00
parent 0db1eaa55a
commit 1c6d51f271
12 changed files with 38 additions and 43 deletions

View File

@ -10,10 +10,10 @@ module bits
// To rotate x right by k bits, call rotate_left_8(x, -k).
//
// This function's execution time does not depend on the inputs.
pub fn rotate_left_8(x u8, k int) u8 {
n := u8(8)
s := u8(k) & u8(n - u8(1))
return u8((x<<s) | (x>>(n-s)))
pub fn rotate_left_8(x byte, k int) byte {
n := byte(8)
s := byte(k) & byte(n - byte(1))
return byte((x<<s) | (x>>(n-s)))
}
// rotate_left_16 returns the value of x rotated left by (k mod 16) bits.