How to create a `range` centered around zero?

In that case simply constructing a StepRangeLen with an offset as described above is your best bet, e.g. zerorange(max, len) = let s=max/len; StepRangeLen(zero(s), s, 2len+1, len+1); end constructs a range from -max to max with 2len+1 points that exactly hits zero.

5 Likes