25 ms·
I was looking through the source and learned that Python's modulo operator is based on floor-division (rather than round-toward-0 division like in C). In case
by kmill 9y ago
I was looking through the source and learned that Python's modulo operator is based on floor-division (rather than round-toward-0 division like in C). In case anyone cares how Python actually does in in C, for small ints its defined at https://github.com/python/cpython/blob/master/Objects/longobject.c#L3599 https://github.com/python/cpython/blob/master/Objects/longob...