News for hackers. Stuff that matters.
Re:A web of trust for NPM by TimWolla on Saturday October 03, 2020 @08:24PM (#24675729)
According to https://en.wikipedia.org/wiki/Modulo_operation#In_programmin...:

- JavaScript is consistent with Java, PHP.

- Older C may behave as either Python or JavaScript.

- Modern C behaves like JavaScript.

So basically Python is the outlier here.

Re:A web of trust for NPM by 3pt14159 on Sunday October 04, 2020 @02:27PM (#24681137)
Outlier is a bit of a strong word. Ruby and many others[0] implement it the same way. Personally, I think the way Ruby does it is the most intuitive. The % operator is a modulo, and there is a separate method for remainder. Even though I prefer this way, I'm dismayed that there are multiple ways of doing it. Like so many things created by humanity, we just can't ever seem to take one definition and stick to it.

[0] https://en.wikipedia.org/wiki/Modulo_operation#In_programmin...