[#mp_units-hypot-00]
= xref:mp_units.adoc[mp&lowbar;units]::hypot
:relfileprefix: ../
:mrdocs:

`hypot` overloads

== Synopses

Declared in `&lt;mp&hyphen;units&sol;math&period;h&gt;`

Computes the square root of the sum of the squares of x and y, without undue overflow or underflow at intermediate stages of the computation


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    auto R1,
    typename Rep1,
    auto R2,
    typename Rep2&gt;
requires requires(Rep1 v1, Rep2 v2) &lcub;
    get&lowbar;common&lowbar;reference(R1, R2)&semi;
    requires requires &lcub; hypot(v1, v2)&semi; &rcub;
&num;if MP&lowbar;UNITS&lowbar;HOSTED
               &verbar;&verbar; requires &lcub; std&colon;&colon;hypot(v1, v2)&semi; &rcub;
&num;endif
               &semi;
  &rcub;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
xref:mp_units/QuantityOf.adoc[QuantityOf&lt;get&lowbar;quantity&lowbar;spec(get&lowbar;common&lowbar;reference(R1, R2))&gt;] auto
xref:mp_units/hypot-03.adoc[hypot](
    xref:mp_units/quantity-01.adoc[quantity&lt;R1, Rep1&gt;] const& x,
    xref:mp_units/quantity-01.adoc[quantity&lt;R2, Rep2&gt;] const& y) noexcept;
----

[.small]#xref:mp_units/hypot-03.adoc[_» more&period;&period;&period;_]#

Computes the square root of the sum of the squares of x, y, and z, without undue overflow or underflow at intermediate stages of the computation


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    auto R1,
    typename Rep1,
    auto R2,
    typename Rep2,
    auto R3,
    typename Rep3&gt;
requires requires(Rep1 v1, Rep2 v2, Rep3 v3) &lcub;
    get&lowbar;common&lowbar;reference(R1, R2, R3)&semi;
    requires requires &lcub; hypot(v1, v2, v3)&semi; &rcub;
&num;if MP&lowbar;UNITS&lowbar;HOSTED
               &verbar;&verbar; requires &lcub; std&colon;&colon;hypot(v1, v2, v3)&semi; &rcub;
&num;endif
               &semi;
  &rcub;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
xref:mp_units/QuantityOf.adoc[QuantityOf&lt;get&lowbar;quantity&lowbar;spec(get&lowbar;common&lowbar;reference(R1, R2, R3))&gt;] auto
xref:mp_units/hypot-02.adoc[hypot](
    xref:mp_units/quantity-01.adoc[quantity&lt;R1, Rep1&gt;] const& x,
    xref:mp_units/quantity-01.adoc[quantity&lt;R2, Rep2&gt;] const& y,
    xref:mp_units/quantity-01.adoc[quantity&lt;R3, Rep3&gt;] const& z) noexcept;
----

[.small]#xref:mp_units/hypot-02.adoc[_» more&period;&period;&period;_]#

== Return Value

* the square root of the sum of the squares of `x` and `y,` in the common reference of `x` and `y`
* the square root of the sum of the squares of `x,` `y,` and `z,` in the common reference of `x,` `y,` and `z`

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *x*
| first quantity
| *y*
| second quantity
| *z*
| third quantity
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
