Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

isAlignedAnyAlign

Returns true if i is aligned to the given alignment. Works with any positive alignment value, not just powers of 2. For power-of-2 alignments, isAligned is more efficient.

mem.isAlignedAnyAlign
pub fn isAlignedAnyAlign(i: usize, alignment: usize) bool

File

lib/std/mem.zig:4913

Code

pub fn isAlignedAnyAlign(i: usize, alignment: usize) bool {
    if (isValidAlign(alignment))
        return isAligned(i, alignment);
    assert(alignment != 0);
    return 0 == @mod(i, alignment);
}