[Python-ideas] Re: A modulo operator consistent with euclidean division.

2022-03-19 Thread Tim Peters
[Steven D'Aprano ] > Sure, for floats. I certainly wouldn't want to change the behaviour for > floats. We could change the behaviour for ints (or at least we could if > not constrained by backwards compatibility) or add a new function. We could - but why would we? Just because a thing _can_ be don

[Python-ideas] Re: A modulo operator consistent with euclidean division.

2022-03-19 Thread Steven D'Aprano
On Sat, Mar 19, 2022 at 03:49:28PM -0500, Tim Peters wrote: > [Steven D'Aprano ] > > Sure, for floats. I certainly wouldn't want to change the behaviour for > > floats. We could change the behaviour for ints (or at least we could if > > not constrained by backwards compatibility) or add a new funct

[Python-ideas] Re: A modulo operator consistent with euclidean division.

2022-03-19 Thread Ben Rudiak-Gould
On Fri, Mar 18, 2022 at 8:30 PM MRAB wrote: > Wikipedia describes Euclidean division. > > Basically, the modulo is non-negative: > > a == b * q + r where 0 <= r < abs(b) That convention in the Wikipedia article dates back to a 2004 edit by an anonymous (IP) editor. The only reference in that