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

Computes the smallest quantity with integer representation and unit type To with its number not less than q

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    xref:mp_units/Unit.adoc[Unit] auto To,
    auto R,
    typename Rep&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
xref:mp_units/quantity-01.adoc[quantity&lt;detail&colon;&colon;clone&lowbar;reference&lowbar;with&lt;To&gt;(R), Rep&gt;]
ceil(xref:mp_units/quantity-01.adoc[quantity&lt;R, Rep&gt;] const& q) noexcept
requires requires &lcub; q&period;in(To, truncated)&semi; &rcub; &amp;&amp;
           ((treat&lowbar;as&lowbar;floating&lowbar;point&lt;Rep&gt; &amp;&amp; (requires(Rep v) &lcub; ceil(v)&semi; &rcub;
&num;if MP&lowbar;UNITS&lowbar;HOSTED
                                              &verbar;&verbar; requires(Rep v) &lcub; std&colon;&colon;ceil(v)&semi; &rcub;
&num;endif
                                              )) &verbar;&verbar;
            (!treat&lowbar;as&lowbar;floating&lowbar;point&lt;Rep&gt; &amp;&amp; requires &lcub; representation&lowbar;values&lt;Rep&gt;&colon;&colon;one()&semi; &rcub;));
----

== Return Value

Quantity The rounded quantity with unit type To

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

[cols="1,4"]
|===
| Name| Description
| *q*
| Quantity being the base of the operation
|===


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