Mojo function
align_up
align_up(value: Int, alignment: Int) -> Int
Returns the closest multiple of alignment that is greater 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 greater than or equal to the input value. In other words, ceiling(value / alignment) * alignment.
align_up(value: UInt, alignment: UInt) -> UInt
Returns the closest multiple of alignment that is greater 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 greater than or equal to the input value. In other words, ceiling(value / alignment) * alignment.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
π What went wrong?