Multiply two Rats, or a Rat and a number.
(self, other)
| 114 | return NotImplemented |
| 115 | |
| 116 | def __mul__(self, other): |
| 117 | """Multiply two Rats, or a Rat and a number.""" |
| 118 | if isRat(other): |
| 119 | return Rat(self.__num*other.__num, self.__den*other.__den) |
| 120 | if isint(other): |
| 121 | return Rat(self.__num*other, self.__den) |
| 122 | if isnum(other): |
| 123 | return float(self)*other |
| 124 | return NotImplemented |
| 125 | |
| 126 | __rmul__ = __mul__ |
| 127 |
no test coverage detected