sqrt overloads

Synopses

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

Computes the square root of a reference

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

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®, Rep>
sqrt(quantity<R, Rep> const& q) noexcept;

Return Value

  • The result of computation

  • Quantity The result of computation

Note

The return value should not be discarded.

Parameters

Name

Description

r

Reference being the base of the operation

q

Quantity being the base of the operation

Created with MrDocs