Re:Python, unlike C, has the mod operator always return a po...
by bee_rider on Wednesday December 29, 2021 @08:28PM
(#29732437)
Toward zero is a fairly intuitive way to do it, I think. Intuitively, if a you were, say, discretizing a length (L) with a number of steps (n) of some size (d) and went for d=L/n, you might want to always end up with d*n <= L even if L is negative, right? Although, having an integer for d may not make sense, or you might want to take |L| beforehand anyway...
[ Parent
| on HN ]
There are no comments on this comment yet.