zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit ebff436985c9410d2a2759c69a277fcb30831a87 (tree)
parent 56265d6f9934f7321d2001c9d07ce82b0c9be126
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Tue,  5 May 2026 14:39:50 -0700

langref: fix incorrect description of `>>` operation

Diffstat:
Mdoc/langref.html.in | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/doc/langref.html.in b/doc/langref.html.in @@ -1459,7 +1459,15 @@ a >>= b{#endsyntax#}</pre></td> </td> <td> <ul> - <li>Moves all bits to the right, inserting zeroes at the most-significant bit.</li> + <li>When LHS is unsigned, performs a <strong>logical + shift</strong>, moving all bits to the right, inserting zeroes at + the most-significant bit.</li> + + <li>When LHS is signed, performs an <strong>arithmetic + shift</strong>, moving all bits to the right, inserting ones at + the most-significant bit if and only if the most significant bit + is one.</li> + <li>{#syntax#}b{#endsyntax#} must be {#link|comptime-known|comptime#} or have a type with log2 number of bits as {#syntax#}a{#endsyntax#}.</li>