2022-08-04 17:38:00 +12:00
|
|
|
```doc
|
|
|
|
# Multiplication
|
|
|
|
|
|
|
|
Values which wish to implement the `%` infix operator must implement this protocol.
|
|
|
|
```
|
2022-08-07 16:20:33 +12:00
|
|
|
protocol Multiplication, as: do
|
2022-08-04 17:38:00 +12:00
|
|
|
```doc
|
2022-08-07 16:20:33 +12:00
|
|
|
Multiply `self` by `other`, returning an option containing the result
|
2022-08-04 17:38:00 +12:00
|
|
|
|
|
|
|
It is left up to the implementer to define when it should return `Some` or `None`.
|
|
|
|
```
|
2022-08-07 16:20:33 +12:00
|
|
|
def multiply(self: Self, other: Any): Option
|
2022-08-04 17:38:00 +12:00
|
|
|
end
|