Skip to main content

split_evenly

Function split_evenly 

Source
pub fn split_evenly(start_ord: u64, end_ord: u64, n: u64) -> Vec<(u64, u64)>
Expand description

Split [start_ord, end_ord) into n contiguous half-open chunks whose sizes differ by at most one ordinal. Boundary i sits at start_ord + round(i * span / n), so the rounding slack is distributed across the chunks rather than accumulating in the last one. n must be >= 1.

Shared between the */N spec tail token and the subdivide(p, n) node in polydat-nodes so both produce identical boundaries.