outrun/outrun-core/lib/exponentiation.outrun

17 lines
376 B
Text
Raw Normal View History

2022-08-19 16:25:42 +12:00
use Any
use Option
2022-08-04 17:38:00 +12:00
```doc
# Exponentiation
Values which wish to implement the `**` infix operator must implement this protocol.
```
protocol Exponentiation, as: do
2022-08-04 17:38:00 +12:00
```doc
Raise `self` to the power of `other`, returning an option.
2022-08-04 17:38:00 +12:00
It is left up to the implementer to define when it should return `Some` or `None`.
```
def raise(self: Self, other: Any): Option
2022-08-04 17:38:00 +12:00
end