Closed saxbophone closed 1 year ago
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
We can call the members
quotient
andremainder
.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 ofInterval<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
andstd::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 useDivision
explicitly, and instead keep the structured bindings usage: https://stackoverflow.com/a/37188019/6177253Depends on #136