Skip to main content

Mojo function

udivmod

udivmod(a: Int, b: Int) -> Tuple[Int, Int]

Perform unsigned divmod on Int arguments.

Computes the quotient and remainder in a single unsigned division, which is faster than signed divmod on NVIDIA GPUs.

For correctness, both arguments should be non-negative integers.

Args:

  • a (Int): The dividend (treated as unsigned).
  • b (Int): The divisor (treated as unsigned).

Returns:

Tuple: A Tuple of (quotient, remainder) from unsigned division.

Was this page helpful?