<p dir="auto">This issue is just tracking <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="165843501" data-permission-text="Title is private" data-url="https://github.com/JuliaStats/Rmath.jl/issues/7" data-hovercard-type="issue" data-hovercard-url="/JuliaStats/Rmath.jl/issues/7/hovercard" href="https://github.com/JuliaStats/Rmath.jl/issues/7">JuliaStats/Rmath.jl#7</a>. I believe this issue here needs to be added to the 0.5.0 milestone, and that is why I added a duplicate here in the julia repo.</p>
<p dir="auto">My understanding is that StatsFuns.jl relies on rmath. Previously rmath was part of base and worked on all platforms. <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="29285302" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/6131" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/6131/hovercard" href="https://github.com/JuliaLang/julia/issues/6131">#6131</a> moved it out into JuliaStats/Rmath.jl, but that package doesn't work on Windows, so now StatsFuns.jl doesn't work anymore on Windows, and with that essentially the whole julia statistics stack.</p>
<p dir="auto">My main grudge with the 1-based array indexing common in scientific programming languages is that it makes cyclic array-indexing a pain:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="n = length(a)
a[mod(i-1,n)+1]"><pre class="notranslate"><code class="notranslate">n = length(a)
a[mod(i-1,n)+1]
</code></pre></div>
<p dir="auto">The only language I know which solves this problem reasonably elegantly is Mathematica whose <code class="notranslate">Mod</code> function <a href="https://reference.wolfram.com/language/ref/Mod.html" rel="nofollow">takes an optional third argument</a> which is an offset that shifts the representatives of the remainder classes. E.g. <code class="notranslate">mod(x,3,1)</code> would return a number in <code class="notranslate">3, 1, 2</code> instead of <code class="notranslate">0, 1, 2</code>. This makes cyclic 1-based indexing a lot neater:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="n = length(a)
a[mod(i,n,1)]"><pre class="notranslate"><code class="notranslate">n = length(a)
a[mod(i,n,1)]
</code></pre></div>
<p dir="auto">I don't know if this would also be a useful feature for <code class="notranslate">rem</code>, especially because <code class="notranslate">rem(x,n)</code> doesn't come with the semantics "this function will always return one of <code class="notranslate">n</code> values".</p>