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

A quantity

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    xref:mp_units/Reference-0ba.adoc[Reference] auto R,
    xref:mp_units/RepresentationOf.adoc[RepresentationOf&lt;get&lowbar;quantity&lowbar;spec(R)&gt;] Rep = double&gt;
class quantity
    : public &sol;&ast; implementation-defined &ast;&sol;
----

== Description

Property of a phenomenon, body, or substance, where the property has a magnitude that can be expressed by means of a number and a reference&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `&sol;&ast; implementation-defined &ast;&sol;`
| 
|===

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:mp_units/quantity-01/rep.adoc[`rep`] 
| The type used to represent the numerical value of the quantity&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:mp_units/quantity-01/2constructor-06a.adoc[`quantity`]         [.small]#[constructor]#
| Constructors
| xref:mp_units/quantity-01/operator_assign.adoc[`operator&equals;`] 
| Assigns a new numerical value to `&ast;this`&period;
| xref:mp_units/quantity-01/force_in-02.adoc[`force&lowbar;in`]  [.small]#[deprecated]#
| `force&lowbar;in` overloads
| xref:mp_units/quantity-01/force_numerical_value_in.adoc[`force&lowbar;numerical&lowbar;value&lowbar;in`]  [.small]#[deprecated]#
| Deprecated&period; Returns the numerical value converted to another unit, truncating if inexact&period;
| xref:mp_units/quantity-01/in-08.adoc[`in`] 
| `in` overloads
| xref:mp_units/quantity-01/magnitude.adoc[`magnitude`] 
| Computes the Euclidean (or, for a complex field, Hermitian) norm of a vector or tensor quantity&period;
| xref:mp_units/quantity-01/numerical_value_in-05.adoc[`numerical&lowbar;value&lowbar;in`] 
| `numerical&lowbar;value&lowbar;in` overloads
| xref:mp_units/quantity-01/numerical_value_ref_in-0d.adoc[`numerical&lowbar;value&lowbar;ref&lowbar;in`] 
| `numerical&lowbar;value&lowbar;ref&lowbar;in` overloads
| xref:mp_units/quantity-01/operator_mod_eq.adoc[`operator%&equals;`] 
| Computes the remainder of division by another quantity and assigns it to `&ast;this`&period;
| xref:mp_units/quantity-01/operator_star_eq-01.adoc[`operator&ast;&equals;`] 
| Multiplication assignment operators
| xref:mp_units/quantity-01/operator_plus.adoc[`operator&plus;`] 
| Applies unary `&plus;` to the numerical value&period;
| xref:mp_units/quantity-01/operator_inc-0e.adoc[`operator&plus;&plus;`] 
| Increment operators
| xref:mp_units/quantity-01/operator_plus_eq.adoc[`operator&plus;&equals;`] 
| Adds another quantity to `&ast;this` and assigns the result to `&ast;this`&period;
| xref:mp_units/quantity-01/operator_minus.adoc[`operator&hyphen;`] 
| Negates the numerical value&period;
| xref:mp_units/quantity-01/operator_dec-07.adoc[`operator&hyphen;&hyphen;`] 
| Decrement operators
| xref:mp_units/quantity-01/operator_minus_eq.adoc[`operator&hyphen;&equals;`] 
| Subtracts another quantity from `&ast;this` and assigns the result to `&ast;this`&period;
| xref:mp_units/quantity-01/operator_slash_eq-04.adoc[`operator&sol;&equals;`] 
| Division assignment operators
| xref:mp_units/quantity-01/2conversion-08.adoc[`operator Q&lowbar;`] 
| Converts the quantity to an external quantity&hyphen;like type via `quantity&lowbar;like&lowbar;traits`&period;
| xref:mp_units/quantity-01/2conversion-05.adoc[`operator V&lowbar;`] 
| Explicitly converts the quantity to its bare numerical value&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:mp_units/quantity-01/max.adoc[`max`] 
| Returns a quantity holding the representation type&apos;s highest finite value&period;
| xref:mp_units/quantity-01/min.adoc[`min`] 
| Returns a quantity holding the representation type&apos;s lowest finite value&period;
| xref:mp_units/quantity-01/zero.adoc[`zero`] 
| Returns a quantity holding the representation type&apos;s zero value&period;
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:mp_units/quantity-01/numerical_value_is_an_implementation_detail_.adoc[`numerical&lowbar;value&lowbar;is&lowbar;an&lowbar;implementation&lowbar;detail&lowbar;`] 
| needs to be public for a structural type
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:mp_units/quantity-01/character.adoc[`character`] 
| The quantity character (tensor order and numeric field) extracted from `quantity&lowbar;spec`&period;
| xref:mp_units/quantity-01/dimension.adoc[`dimension`] 
| The dimension extracted from `quantity&lowbar;spec`&period;
| xref:mp_units/quantity-01/quantity_spec.adoc[`quantity&lowbar;spec`] 
| The quantity specification extracted from `reference`&period;
| xref:mp_units/quantity-01/reference.adoc[`reference`] 
| The reference of the quantity, as provided via the `R` template parameter&period;
| xref:mp_units/quantity-01/unit.adoc[`unit`] 
| The unit extracted from `reference`&period;
|===


== Deduction Guides

[cols="1,4"]
|===
| Name| Description
| xref:mp_units/quantity-03.adoc[`quantity&lt;R, representation&lowbar;canonical&lowbar;type&lowbar;t&lt;Value&gt;&gt;`] 
| Deduces a `quantity` from a numerical value alone, using the `one` reference by default&period;
| xref:mp_units/quantity-057.adoc[`quantity&lt;R&lcub;&rcub;, representation&lowbar;canonical&lowbar;type&lowbar;t&lt;Value&gt;&gt;`] 
| Deduces a `quantity` from a numerical value and an explicit reference&period;
| xref:mp_units/quantity-051.adoc[`quantity&lt;quantity&lowbar;like&lowbar;traits&lt;Q&gt;&colon;&colon;reference, quantity&lowbar;like&lowbar;traits&lt;Q&gt;::rep&gt;`] 
| Deduces a `quantity` from an external quantity&hyphen;like type via `quantity&lowbar;like&lowbar;traits`&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:mp_units/abs.adoc[`abs`]
| Computes the absolute value of a quantity
| xref:mp_units/cbrt-01.adoc[`cbrt`]
| Computes the cubic root of a quantity
| xref:mp_units/ceil-05.adoc[`ceil`]
| Computes the smallest quantity with integer representation and unit type To with its number not less than q
| xref:mp_units/delta.adoc[`delta`]
| Constructs a `quantity` of reference `R` from a raw representation value
| xref:mp_units/epsilon.adoc[`epsilon`]
| Returns the epsilon of the quantity
| xref:mp_units/exp.adoc[`exp`]
| Computes Euler&apos;s raised to the given power
| xref:mp_units/floor-09.adoc[`floor`]
| Computes the largest quantity with integer representation and unit type To with its number not greater than q
| xref:mp_units/fma-06.adoc[`fma`]
| Computes the fma of 3 quantities
| xref:mp_units/fma-0d.adoc[`fma`]
| Computes the fma of 2 quantities and a quantity point
| xref:mp_units/fmod.adoc[`fmod`]
| Computes the floating&hyphen;point remainder of the division operation x &sol; y&period;
| xref:mp_units/hypot-02.adoc[`hypot`]
| 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
| xref:mp_units/hypot-03.adoc[`hypot`]
| 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
| xref:mp_units/inverse-09.adoc[`inverse`]
| Computes the inverse of a quantity in a provided unit
| xref:mp_units/isfinite-03.adoc[`isfinite`]
| Determines if a quantity is finite&period;
| xref:mp_units/isinf-04.adoc[`isinf`]
| Determines if a quantity is infinite&period;
| xref:mp_units/isnan-0b.adoc[`isnan`]
| Determines if a quantity is a nan&period;
| xref:mp_units/operator_star-06f.adoc[`operator&ast;`]
| Constructs a quantity from a representation value and a reference
| xref:mp_units/pow-06.adoc[`pow`]
| Computes the value of a quantity raised to the `Num&sol;Den` power
| xref:mp_units/remainder.adoc[`remainder`]
| Computes the IEEE remainder of the floating point division operation x &sol; y&period;
| xref:mp_units/round-0e.adoc[`round`]
| Computes the nearest quantity with integer representation and unit type `To` to `q`
| xref:mp_units/sqrt-0b.adoc[`sqrt`]
| Computes the square root of a quantity
| xref:mp_units/value_cast-04.adoc[`value&lowbar;cast`]
| Explicit cast of a quantity&apos;s representation type
|===

== Template Parameters

[cols="1,4"]
|===
| Name| Description
| *R*
| a reference of the quantity providing all information about quantity properties
| *Rep*
| a type to be used to represent values of a quantity
|===


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