Function

CGAL::div_mod

Definition

The function div_mod computes the integral quotient and remainder of division with remainder.

In case the argument types NT1 and NT2 differ, the result_type is determined via Coercion_traits.
Thus, the result_type is well defined if NT1 and NT2 are a model of ExplicitInteroperable.
The actual div_mod is performed with the semantic of that type.

The function is defined if result_type is a model of the EuclideanRing concept.

#include <CGAL/number_utils.h>

template <class NT1, class NT2>
void div_mod ( NT1 x, 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 result_type.

See Also

EuclideanRing
AlgebraicStructureTraits::DivMod
CGAL::mod
CGAL::div