Skip to main content
Log in

Mojo function

align_down

align_down(value: Int, alignment: Int) -> Int

Returns the closest multiple of alignment that is less than or equal to value.

Args:

  • value (Int): The value to align.
  • alignment (Int): Value to align to.

Returns:

Closest multiple of the alignment that is less than or equal to the input value. In other words, floor(value / alignment) * alignment.

align_down(value: UInt, alignment: UInt) -> UInt

Returns the closest multiple of alignment that is less than or equal to value.

Args:

  • value (UInt): The value to align.
  • alignment (UInt): Value to align to.

Returns:

Closest multiple of the alignment that is less than or equal to the input value. In other words, floor(value / alignment) * alignment.