3 ms·
Julia actually just includes a dedicated function for this case (mod1), and that covers the vast majority of places where 0 base is easier. In my cases of nume
by Certhas 7y ago
Julia actually just includes a dedicated function for this case (mod1), and that covers the vast majority of places where 0 base is easier.
In my cases of numerical code 1 based indexing causes fewer ±1 than 0 based indexing. (Nitpick: In modulo arithmetic 0 = N so having the index run from 1 to N is a ring just as well. The problem is the conventional representation of the equivalence class -N,0,N,2N,3N… in the numbers being 0 (which arises from arithmetics definition of modulo))