4 lines
4.6 KiB
HTML
4 lines
4.6 KiB
HTML
<!DOCTYPE html><html lang='en'><head><title>[qty.is.child.of]</title><meta charset='UTF-8'/><link rel='stylesheet' type='text/css' href='14882.css'/><link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css2?family=Noto+Serif'/><link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css2?family=Noto+Sans'/><link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css2?family=Noto+Sans+Mono'/><link rel='icon' href='icon.png'/><link rel='stylesheet' type='text/css' href='expanded.css' title='Normal'/><link rel='alternate stylesheet' type='text/css' href='colored.css' title='Notes and examples colored'/><link rel='alternate stylesheet' type='text/css' href='normative-only.css' title='Notes and examples hidden'/></head><body><div class='wrapper'><h1 ><a class='secnum' style='min-width:50pt'>5</a> Quantities and units library <a class='abbr_ref' href='index.html#quantities'>[quantities]</a></h1><h2 ><a class='secnum' style='min-width:65pt'>5.4</a> Reference <a class='abbr_ref' href='qty.ref.html#qty.is.child.of'>[qty.ref]</a></h2><h3 ><a class='secnum' style='min-width:80pt'>5.4.3</a> Quantity specification <a class='abbr_ref' href='qty.spec.html#qty.is.child.of'>[qty.spec]</a></h3><h4 ><a class='secnum' style='min-width:95pt'>5.4.3.6</a> Hierarchy algorithms <a class='abbr_ref' href='qty.spec.hier.algos.html#qty.is.child.of'>[qty.spec.hier.algos]</a></h4><h4 ><a class='secnum' style='min-width:110pt'>5.4.3.6.5</a> Is child of <a class='abbr_ref'>[qty.is.child.of]</a></h4><div class='texpara'><div id='lib:is-child-of,QuantitySpec'><div id='lib:QuantitySpec,is-child-of'><div class='itemdecl'><div class='marginalizedparent'><a class='itemDeclLink' href='#lib:QuantitySpec,is-child-of'>🔗</a></div><code class='itemdeclcode'><span class='keyword'>template</span><span class='anglebracket'><</span><a href='qty.spec.concepts.html#concept:QuantitySpec' title='5.4.3.2 Concepts [qty.spec.concepts]'><span id='conceptref:QuantitySpec'><span class='texttt'>QuantitySpec</span></span></a> Child, <a href='qty.spec.concepts.html#concept:QuantitySpec' title='5.4.3.2 Concepts [qty.spec.concepts]'><span id='conceptref:QuantitySpec_'><span class='texttt'>QuantitySpec</span></span></a> Parent<span class='anglebracket'>></span>
|
|
<span class='keyword'>consteval</span> <span class='keyword'>bool</span> <span class='texttt'><i >is-child-of</i></span><span class='parenthesis'>(</span>Child ch, Parent p<span class='parenthesis'>)</span>; <span class='comment'>// <i >exposition only</i></span>
|
|
</code></div></div></div></div><div class='para' id='1'><div class='marginalizedparent'><a class='marginalized' href='#1'>1</a></div><div class='itemdescr'><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/mpusz/mp-unitse9c5f7236ebfe1b287a5a4a49aaf57fbefa87233/source/quantities.tex#L2262'>#</a></div><div class='texpara'><div id='1.sentence-1' class='sentence'><i >Returns</i>: If <span class='math'><span class='mathalpha'>h</span>(<span class='texttt'>p</span>)</span> has more elements than <span class='math'><span class='mathalpha'>h</span>(<span class='texttt'>ch</span>)</span>, returns <span class='texttt'><span class='literal'>false</span></span><a class='hidden_link' href='#1.sentence-1'>.</a></div> <div id='1.sentence-2' class='sentence'>Otherwise, let <span class='math'><span class='mathalpha'>C</span></span> be a tuple of the last <span class='math'><span class='mathalpha'>s</span></span> elements of <span class='math'><span class='mathalpha'>h</span>(<span class='texttt'>ch</span>)</span>,
|
|
where <span class='math'><span class='mathalpha'>s</span></span> is the number of elements in <span class='math'><span class='mathalpha'>h</span>(<span class='texttt'>p</span>)</span><a class='hidden_link' href='#1.sentence-2'>.</a></div> <div id='1.sentence-3' class='sentence'>Returns <span class='texttt'><span class="mjx-chtml"><span class="mjx-math"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base" style="margin-right: -0.045em;"><span class="mjx-mi"><span class="mjx-char MJXc-TeX-math-I" style="padding-top: 0.519em; padding-bottom: 0.298em; padding-right: 0.045em;">C</span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-mn"><span class="mjx-char MJXc-TeX-main-R" style="padding-top: 0.372em; padding-bottom: 0.372em;">0</span></span></span></span></span></span></span> <span class='operator'>=</span><span class='operator'>=</span> p</span><a class='hidden_link' href='#1.sentence-3'>.</a></div></div></div></div></div></body></html> |