Tim Peters wrote: > Do note that this discussion is only about Python 3. Under the view > that it was a (minor, but real) design error to /try/ extending > Python's integer mod definition to floats, if __mod__, and __divmod__ > and __floordiv__ go away for binary floats in P3K they should > certainly go away for decimal floats in P3K too.
What design error? float.__mod__ works perfectly. >>> -1 % 50 49 >>> -1.0 % 50.0 49.0 >>> It's only Decimal.__mod__ that's inconsistent. float.__mod__ has the usual floating-point inaccuracies, but then with float that goes with the territory. I've had occasion to use it, and it was a pleasant surprise that it "just worked", so I didn't have to go to the math module and ponder over the difference between modulo or remainder. float modulo is useful, consistent and intuitive; -1 on removing that. - Anders _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com