4 ms·
> number of elements to process is exactly the difference between last and first index of the range And in Julia, it’s length(a:b) which also works with no
by nequo 3y ago
> number of elements to process is exactly the difference between last and first index of the range
And in Julia, it’s
length(a:b)
which also works with non-unit step sizes like
length(a:x:b)
The intent of these expressions seems clearer than the intent of `b-a` and `ceiling((b-a)/x)` with your proposed approach in a zero-indexed language.