Skip to main content

next_in_sequence

Function next_in_sequence 

Source
fn next_in_sequence(cursor: i64, start: i64, interval: i64) -> Result<i64>
Expand description

The smallest start + k * interval value that is strictly after cursor (start itself lies on the anchor + k * interval lattice, so every result is phase-consistent with the anchor). All arithmetic happens in i128: cursor - start cannot overflow and the result is either exactly on the lattice or an explicit error.