16 lines
374 B
Text
16 lines
374 B
Text
use Any
|
|
use Option
|
|
|
|
```doc
|
|
# Modulus
|
|
|
|
Values which wish to implement the `%` infix operator must implement this protocol.
|
|
```
|
|
protocol Modulus, as: do
|
|
```doc
|
|
Divide `self` by `other`, returning an option containing the remainder
|
|
|
|
It is left up to the implementer to define when it should return `Some` or `None`.
|
|
```
|
|
def modulo(self: Self, other: Any): Option
|
|
end
|