3 ms·
Basically if you do any kind of modulo arithmetic on an index you need to shift by 1 in a 1-based indexing system, while 0-based just works.
by 0-_-0 7y ago
Basically if you do any kind of modulo arithmetic on an index you need to shift by 1 in a 1-based indexing system, while 0-based just works.
- Oreb 7y agoWhich is why Julia offers the `fld1`, `mod1` and `fldmod1` functions: https://docs.julialang.org/en/v1/base/math/#Base.fld1 https://docs.julialang.org/en/v1/base/math/#Base.fld1