[−][src]Function treeid::bitter::rotate_add
pub fn rotate_add(x: u8, y: u8) -> u8
Adds y
to x
, rotating back to 0
if the result
exceeds 8
.
No distinction is made in the number of rotations.
use treeid::bitter::*; assert_eq!(1, rotate_add(0, 1)); assert_eq!(7, rotate_add(0, 7)); assert_eq!(0, rotate_add(0, 8)); assert_eq!(1, rotate_add(0, 9)); assert_eq!(7, rotate_add(0, 15)); assert_eq!(0, rotate_add(0, 16));