Skip to content

c8_natural_divide_modulus

Dave Hudson edited this page May 3, 2017 · 3 revisions

c8::natural::divide_modulus

auto divide_modulus(natural_digit v) const -> std::pair<natural, natural_digit>;
auto divide_modulus(const natural &v) const -> std::pair<natural, natural>;

Divides the value of this object by v (right hand side of the operator). The result is a pair that represents the quotient, and the remainder.

Return Value

A std::pair that represents the quotient and the remainder. first represents the quotient, while second represents the remainder.

Exceptions

  • std::bad_alloc in the event of a memory allocation failure.
  • c8::divide_by_zero if the divisor, v is zero.

See Also

Clone this wiki locally