diff --git a/ortools/sat/python/cp_model.py b/ortools/sat/python/cp_model.py index be6f2282b3..27513448c8 100644 --- a/ortools/sat/python/cp_model.py +++ b/ortools/sat/python/cp_model.py @@ -2205,7 +2205,19 @@ def add_abs_equality(self, target: LinearExprT, expr: LinearExprT) -> Constraint def add_modulo_equality( self, target: LinearExprT, expr: LinearExprT, mod: LinearExprT ) -> Constraint: - """Adds `target = expr % mod`.""" + """Adds `target = expr % mod. + + It uses the C convention, that is the result is the remainder of the + integral divisiion rounded towards 0. + + Args: + target: the target expression. + expr: the expression to compute the modulo of. + mod: the modulus expression. + + Returns: + A `Constraint` object. + """ ct = Constraint(self) model_ct = self.__model.constraints[ct.index] model_ct.int_mod.exprs.append(self.parse_linear_expression(expr))