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 standard library.
std › math › testCeilPowerOfTwo Private Function testCeilPowerOfTwo Doc Source Private Function std.math.testCeilPowerOfTwo
fn testCeilPowerOfTwo () !void File math.zig: 1263
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273 fn testCeilPowerOfTwo () !void {
try testing .expectEqual (@as (u32 , 1 ), try ceilPowerOfTwo (u32 , 1 ));
try testing .expectEqual (@as (u32 , 2 ), try ceilPowerOfTwo (u32 , 2 ));
try testing .expectEqual (@as (u32 , 64 ), try ceilPowerOfTwo (u32 , 63 ));
try testing .expectEqual (@as (u32 , 64 ), try ceilPowerOfTwo (u32 , 64 ));
try testing .expectEqual (@as (u32 , 128 ), try ceilPowerOfTwo (u32 , 65 ));
try testing .expectEqual (@as (u5 , 8 ), try ceilPowerOfTwo (u5 , 7 ));
try testing .expectEqual (@as (u5 , 8 ), try ceilPowerOfTwo (u5 , 8 ));
try testing .expectEqual (@as (u5 , 16 ), try ceilPowerOfTwo (u5 , 9 ));
try testing .expectError (error .Overflow , ceilPowerOfTwo (u4 , 9 ));
}