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:
@ -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.
|
||||
|
Reference in New Issue
Block a user