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.
Zig › std/ › math.zig › testFloorPowerOfTwo
testFloorPowerOfTwo
math.testFloorPowerOfTwo
fn testFloorPowerOfTwo () !void
File
Code
fn testFloorPowerOfTwo () !void {
try testing .expect (floorPowerOfTwo (u32 , 63 ) == 32 );
try testing .expect (floorPowerOfTwo (u32 , 64 ) == 64 );
try testing .expect (floorPowerOfTwo (u32 , 65 ) == 64 );
try testing .expect (floorPowerOfTwo (u32 , 0 ) == 0 );
try testing .expect (floorPowerOfTwo (u4 , 7 ) == 4 );
try testing .expect (floorPowerOfTwo (u4 , 8 ) == 8 );
try testing .expect (floorPowerOfTwo (u4 , 9 ) == 8 );
try testing .expect (floorPowerOfTwo (u4 , 0 ) == 0 );
try testing .expect (floorPowerOfTwo (i4 , 7 ) == 4 );
try testing .expect (floorPowerOfTwo (i4 , -8 ) == 0 );
try testing .expect (floorPowerOfTwo (i4 , -1 ) == 0 );
try testing .expect (floorPowerOfTwo (i4 , 0 ) == 0 );
}