mp_units::sqrt

sqrt overloads

Synopses

Declared in <mp-units/framework/reference.h>

Computes the square root of a reference

[[nodiscard]]
consteval
/* implementation-defined */
sqrt(reference r);
» more...

Computes the square root of a quantity

template<
    auto R,
    typename Rep>
requires requires(Rep v) { sqrt(v); }
#if MP_UNITS_HOSTED
           || requires(Rep v) { std::sqrt(v); }
[[nodiscard]]
constexpr
quantity<sqrt(R), Rep>
sqrt(quantity<R, Rep> const& q) noexcept;
» more...

Return Value

  • The result of computation
  • Quantity The result of computation

NOTE

The return value should not be discarded.

Parameters

NameDescription
rReference being the base of the operation
qQuantity being the base of the operation