xo-unit: fix ratio_floor() + check args to Quantity converter
This commit is contained in:
parent
39ca2aa9f4
commit
03717ea7e9
2 changed files with 2 additions and 1 deletions
|
|
@ -502,6 +502,7 @@ namespace xo {
|
|||
* @pre @c Quantity2 must have the same dimension as @c *this.
|
||||
**/
|
||||
template <typename Quantity2>
|
||||
requires quantity_concept<Quantity2> && same_dimension_v<unit_type, typename Quantity2::unit_type>
|
||||
constexpr operator Quantity2 () const {
|
||||
/* avoid truncating precision when converting:
|
||||
* use best available representation
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace xo {
|
|||
|
||||
template <typename Ratio>
|
||||
struct ratio_floor {
|
||||
using type = std::ratio<Ratio::num/Ratio::den>;
|
||||
using type = std::ratio<Ratio::num/Ratio::den, 1>;
|
||||
};
|
||||
|
||||
template <typename Ratio>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue