divide_and_modulus#

Fully qualified name: carb::math::divide_and_modulus

Defined in carb/math/Int128.h

inline int128_t carb::math::divide_and_modulus(
const int128_t &dividend,
const int128_t &divisor,
int128_t &modulus,
) noexcept#

Performs a division operation with two signed 128-bit integers and provides both the quotient and remainder.

Effectively:

quotient = dividend / divisor;
modulus = dividend % divisor;

Parameters:
  • dividend – The 128-bit signed dividend.

  • divisor – The 128-bit signed divisor.

  • modulus – Receives the 128-bit signed remainder.

Returns:

The 128-bit signed quotient.