xo-unit: + Quantity.add support
This commit is contained in:
parent
8548f26143
commit
e1d7f62ca6
6 changed files with 120 additions and 13 deletions
|
|
@ -102,6 +102,13 @@ namespace xo {
|
|||
return bpu<Int>(native_dim(), scalefactor(), power_.negate());
|
||||
}
|
||||
|
||||
template <typename Int2>
|
||||
constexpr bpu<Int2> to_repr() const {
|
||||
return bpu<Int2>(this->native_dim(),
|
||||
this->scalefactor(),
|
||||
ratio::ratio<Int2>(power_.num(), power_.den()));
|
||||
}
|
||||
|
||||
/** @brief this unit represents native dimension taken to this power **/
|
||||
power_ratio_type power_;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue