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:
Returns:
Int: Closest multiple of the alignment that is less than or equal to the
input value. In other words, floor(value / alignment) * alignment.
align_down[dtype: DType, width: Int, //](value: SIMD[dtype, width], alignment: SIMD[dtype, width]) -> SIMD[dtype, width] where dtype.is_integral()
Returns the closest multiple of alignment that is less than or equal to value, elementwise.
Parameters:
- dtype (
DType): Thedtypeof the input SIMD vector. - width (
Int): The width of the input and output SIMD vector.
Args:
Returns:
SIMD: Closest multiple of the alignment that is less than or equal to the
input value. In other words, floor(value / alignment) * alignment.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!