Division<T> type for representing result of division with remainder
saxbophone opened this issue · 3 comments
We can call the members quotient
and remainder
.
We can also provide some kind of way to convert a division result to an Interval<T>
, probably as either a cast operator, to_interval()
method or using a converting constructor of Interval<T>
.
Also should provide a templated converting constructor for converting from instances of this template on other types, so we can take advantage of say automatic casting from Nat <-> Int
without needing to special-case them.
This should naturally, support the same tuple item-getter interface of std::pair
and std::tuple
, so we can still use our replacement type with structured bindings. With this in mind, we would do best to not change our existing tests to use Division
explicitly, and instead keep the structured bindings usage: https://stackoverflow.com/a/37188019/6177253
Depends on #136
Consider custom std::cout
output as quotient and remainder, e.g. 9r2
Here's some helpful info on how to support the same interface that tuple/pair use: https://dominikberner.ch/structured-bindings/
should also support converting to Interval<T>
for ceiling and floor