xo-unit: + scaled_unit.is_natural()

This commit is contained in:
Roland Conybeare 2024-05-07 11:51:32 -04:00
commit e72760925f
2 changed files with 5 additions and 0 deletions

View file

@ -29,6 +29,11 @@ namespace xo {
1.0 / outer_scale_sq_);
}
/** @brief true iff scaled unit can be faithfully represented by a @ref natural_unit **/
constexpr bool is_natural() const {
return (outer_scale_factor_ = OuterScale(1) && (outer_scale_sq_ == 1.0));
}
public: /* need public members so that a scaled_unit instance can be a non-type template parameter (a structural type) */
natural_unit<Int> natural_unit_;