Divide two Rats, returning quotient and remainder.
(self, other)
| 160 | return x.__num // x.__den |
| 161 | |
| 162 | def __divmod__(self, other): |
| 163 | """Divide two Rats, returning quotient and remainder.""" |
| 164 | if isint(other): |
| 165 | other = Rat(other) |
| 166 | elif not isRat(other): |
| 167 | return NotImplemented |
| 168 | x = self//other |
| 169 | return (x, self - other * x) |
| 170 | |
| 171 | def __rdivmod__(self, other): |
| 172 | """Divide two Rats, returning quotient and remainder (reversed args).""" |