cgal/Algebraic_foundations/doc_tex/Algebraic_foundations_ref/div_mod.tex

37 lines
1.1 KiB
TeX

\begin{ccRefFunction}{div_mod}
\ccDefinition
The function \ccRefName\ computes the integral quotient and remainder of
division with remainder.
In case the argument types \ccc{NT1} and \ccc{NT2} differ,
the \ccc{result_type} is determined via \ccc{Coercion_traits}.\\
Thus, the \ccc{result_type} is well defined if \ccc{NT1} and \ccc{NT2}
are a model of \ccc{ExplicitInteroperable}. \\
The actual \ccRefName\ is performed with the semantic of that type.
The function is guaranteed to be well defined in case \ccc{result_type}
is a model of the \ccc{EuclideanRing} concept.
\ccInclude{CGAL/number_utils.h}
\ccFunction{
template <class NT1, class NT2>
void
div_mod(const NT1& x, const NT2& y, result_type& q, result_type& r);
}{
computes the quotient $q$ and remainder $r$, such that $x = q*y + r$
and $r$ minimal with respect to the Euclidean Norm of the
\ccc{result_type}.
}
\ccSeeAlso
\ccRefConceptPage{EuclideanRing}\\
\ccRefConceptPage{AlgebraicStructureTraits::DivMod}\\
\ccRefIdfierPage{CGAL::mod}\\
\ccRefIdfierPage{CGAL::div}\\
\end{ccRefFunction}