Skip to main content

tile_count

Function tile_count 

Source
pub fn tile_count(size: u64) -> (u64, u64)
Expand description

Compute the number of full tiles and the partial tile width for a tree of size leaves.

Args:

  • size — Total number of leaves.

Usage:

let (full_tiles, partial_width) = tile_count(300);
assert_eq!(full_tiles, 1);
assert_eq!(partial_width, 44);