mp_units::ceil

Computes the smallest quantity with integer representation and unit type To with its number not less than q

Synopsis

Declared in <mp-units/math.h>

template<
    Unit auto To,
    auto R,
    typename Rep>
[[nodiscard]]
constexpr
quantity<detail::clone_reference_with<To>(R), Rep>
ceil(quantity<R, Rep> const& q) noexcept
requires requires { q.in(To, truncated); } &&
           ((treat_as_floating_point<Rep> && (requires(Rep v) { ceil(v); }
#if MP_UNITS_HOSTED
                                              || requires(Rep v) { std::ceil(v); }
#endif
                                              )) ||
            (!treat_as_floating_point<Rep> && requires { representation_values<Rep>::one(); }));

Return Value

Quantity The rounded quantity with unit type To

NOTE

The return value should not be discarded.

Parameters

NameDescription
qQuantity being the base of the operation