News for hackers. Stuff that matters.
Re:Python, unlike C, has the mod operator always return a po... by dmurray on Thursday December 30, 2021 @04:45AM (#29735218)
Julia already has bounds checking at runtime on array access, so you could do the mod operation only if the bounds check fails.

But I don't get how this would practically work. Would each array have a preferred n that is used for the mod operation? For most situations where that makes sense, using a 2d array seems more logical.

Re:Python, unlike C, has the mod operator always return a po... by half-kh-hacker on Thursday December 30, 2021 @05:16AM (#29735405)
I assume n would be size(a)
Re:Python, unlike C, has the mod operator always return a po... by dmurray on Thursday December 30, 2021 @05:28AM (#29735492)
Oh yeah - I got mixed up on this and thought we wanted to access sub arrays within a.