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.

test__shr_limb64

limb64.test__shr_limb64
fn test__shr_limb64(comptime T: type, a: T, shift: u16, expected: T) !void

File

lib/compiler_rt/limb64.zig:631

Code

fn test__shr_limb64(comptime T: type, a: T, shift: u16, expected: T) !void {
    const int_info = @typeInfo(T).int;
    const is_signed = int_info.signedness == .signed;

    var a_limbs = asLimbs(a);
    var out: Limbs(T) = undefined;
    __shr_limb64(&out, &a_limbs, shift, is_signed, int_info.bits);

    const expected_limbs = asLimbs(expected);
    try testing.expectEqual(expected_limbs, out);
}