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

Computes the fma of 3 quantities

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    auto R,
    auto S,
    auto T,
    typename Rep1,
    typename Rep2,
    typename Rep3&gt;
requires requires &lcub; get&lowbar;common&lowbar;quantity&lowbar;spec(get&lowbar;quantity&lowbar;spec(R) &ast; get&lowbar;quantity&lowbar;spec(S), get&lowbar;quantity&lowbar;spec(T))&semi; &rcub; &amp;&amp;
           (equivalent(get&lowbar;unit(R) &ast; get&lowbar;unit(S), get&lowbar;unit(T))) &amp;&amp; requires(Rep1 v1, Rep2 v2, Rep3 v3) &lcub;
             requires requires &lcub; fma(v1, v2, v3)&semi; &rcub; &verbar;&verbar; requires &lcub; std&colon;&colon;fma(v1, v2, v3)&semi; &rcub;&semi;
           &rcub;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
xref:mp_units/QuantityOf.adoc[QuantityOf&lt;get&lowbar;common&lowbar;quantity&lowbar;spec(get&lowbar;quantity&lowbar;spec(R) &ast; get&lowbar;quantity&lowbar;spec(S), get&lowbar;quantity&lowbar;spec(T))&gt;] auto
fma(
    xref:mp_units/quantity-01.adoc[quantity&lt;R, Rep1&gt;] const& a,
    xref:mp_units/quantity-01.adoc[quantity&lt;S, Rep2&gt;] const& x,
    xref:mp_units/quantity-01.adoc[quantity&lt;T, Rep3&gt;] const& b) noexcept;
----

== Return Value

Quantity&colon; The nearest floating point representable to ax&plus;b

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

[cols="1,4"]
|===
| Name| Description
| *a&colon;*
| Multiplicand
| *x&colon;*
| Multiplicand
| *b&colon;*
| Addend
| *a*
| A quantity
| *x*
| A quantity
| *b*
| A quantity
|===


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