Function Amount.div

Divide this Amount into denominator equal parts and returns the remainder

Amount div (
  ulong denominator
) pure nothrow @nogc @safe;

This function allows to losslessly partition an Amount. Usage example include distributing an Amount evenly among participant, or computing an absolute majority of 2/3rd.

Parameters

NameDescription
denominator The value to divide by. Dividing by 0 is the same as dividing by 1.

Returns

The remainder of the division