3 ms·
The code comment uses variables ‘n’ and ‘s’ without defining them. From context I gather ‘s’ is the upper bound, but what’s ‘n’? And when it says (n * s) numbe
by lilyball 6y ago
The code comment uses variables ‘n’ and ‘s’ without defining them. From context I gather ‘s’ is the upper bound, but what’s ‘n’? And when it says (n * s) numbers contains n values, I’m not sure what that’s supposed to mean either.
- edflsafoiewq 6y ago> Any contiguous range of (n * s) numbers will contain exactly n values where x % s is 0, n values where x % s is 1, and so on, up to n values where x % s is (s - 1). n is any number.
- lilyball 6y agon is any arbitrary number? Oh. Also I just realized I was reading this previously as x and s being fixed values and saying “if x % s is 0, (n * s) has n values”. Hence the confusion.
- shmageggy 6y ago> Lemire uses variable names such as “s”, “t”, “l” which seemingly don’t correspond to much. In such a short piece of code, this actually isn’t too big an offense. I kept these terms in my own implementation, because I want to be consistent with the paper
- lilyball 6y agoYes I saw, but they still need definitions. I shouldn’t have to read the paper to know what the comment is trying to explain.
- deleted 6y ago[deleted]