Divide two Rats, or a Rat and a number (reversed args).
(self, other)
| 136 | return NotImplemented |
| 137 | |
| 138 | def __rtruediv__(self, other): |
| 139 | """Divide two Rats, or a Rat and a number (reversed args).""" |
| 140 | if isRat(other): |
| 141 | return Rat(other.__num*self.__den, other.__den*self.__num) |
| 142 | if isint(other): |
| 143 | return Rat(other*self.__den, self.__num) |
| 144 | if isnum(other): |
| 145 | return other / float(self) |
| 146 | return NotImplemented |
| 147 | |
| 148 | def __floordiv__(self, other): |
| 149 | """Divide two Rats, returning the floored result.""" |