Slice.counted: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/slice.bend as Slice Lines 56-64 of bendtorch-core@0.1.0.0/src/tensor/slice.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/slice.bend&start_line=56&end_line=64 import Base # How many of 0, step, 2 step, ... lie below `span`: none for an empty span, # else 1 + (span - 1) / step, a ceiling division that never forms a number # past span. It takes one division, not a step per index. def counted(+span: Nat, +step: Nat) -> Nat: match span: case 0n: 0n case 1n+rest: 1n+Nat.div(rest, step) Uses (2): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.div