Mojo module
uutils
Utilities for doing unsigned division and modulo operations on Int.
These helpers allow performing unsigned division and modulo operations on Int arguments. This can provide better performance, as these operations can be slower when performed using signed integers on some accelerators, as correctly handling negative values requires additional instructions.
Functions
-
ualign_down: Returns the closest multiple of alignment that is less than or equal to value. -
ualign_up: Returns the closest multiple of alignment that is greater than or equal to value. -
uceildiv: Return the rounded-up result of dividing numerator by denominator. -
udivmod: Perform unsigned divmod on Int arguments. -
ufloordiv: Perform unsigned floor division (//) on Int arguments. -
umod: Perform unsigned modulo (%) on Int arguments.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!