Skip to content

Commit dd79615

Browse files
committed
Doc fixes for clz + ctz
1 parent c619b85 commit dd79615

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

doc/langref.html.in

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7366,18 +7366,20 @@ pub const CallOptions = struct {
73667366
{#header_close#}
73677367

73687368
{#header_open|@clz#}
7369-
<pre>{#syntax#}@clz(comptime T: type, integer: T){#endsyntax#}</pre>
7369+
<pre>{#syntax#}@clz(comptime T: type, operand: T){#endsyntax#}</pre>
7370+
<p>{#syntax#}T{#endsyntax#} must be an integer type.</p>
7371+
<p>{#syntax#}operand{#endsyntax#} may be an {#link|integer|Integers#} or {#link|vector|Vectors#}.</p>
73707372
<p>
7371-
This function counts the number of most-significant (leading in a big-Endian sense) zeroes in {#syntax#}integer{#endsyntax#}.
7373+
This function counts the number of most-significant (leading in a big-Endian sense) zeroes in an integer.
73727374
</p>
73737375
<p>
7374-
If {#syntax#}integer{#endsyntax#} is known at {#link|comptime#},
7376+
If {#syntax#}operand{#endsyntax#} is a {#link|comptime#}-known integer,
73757377
the return type is {#syntax#}comptime_int{#endsyntax#}.
7376-
Otherwise, the return type is an unsigned integer with the minimum number
7378+
Otherwise, the return type is an unsigned integer or vector of unsigned integers with the minimum number
73777379
of bits that can represent the bit count of the integer type.
73787380
</p>
73797381
<p>
7380-
If {#syntax#}integer{#endsyntax#} is zero, {#syntax#}@clz{#endsyntax#} returns the bit width
7382+
If {#syntax#}operand{#endsyntax#} is zero, {#syntax#}@clz{#endsyntax#} returns the bit width
73817383
of integer type {#syntax#}T{#endsyntax#}.
73827384
</p>
73837385
{#see_also|@ctz|@popCount#}
@@ -7509,18 +7511,20 @@ test "main" {
75097511
{#header_close#}
75107512

75117513
{#header_open|@ctz#}
7512-
<pre>{#syntax#}@ctz(comptime T: type, integer: T){#endsyntax#}</pre>
7514+
<pre>{#syntax#}@ctz(comptime T: type, operand: T){#endsyntax#}</pre>
7515+
<p>{#syntax#}T{#endsyntax#} must be an integer type.</p>
7516+
<p>{#syntax#}operand{#endsyntax#} may be an {#link|integer|Integers#} or {#link|vector|Vectors#}.</p>
75137517
<p>
7514-
This function counts the number of least-significant (trailing in a big-Endian sense) zeroes in {#syntax#}integer{#endsyntax#}.
7518+
This function counts the number of least-significant (trailing in a big-Endian sense) zeroes in an integer.
75157519
</p>
75167520
<p>
7517-
If {#syntax#}integer{#endsyntax#} is known at {#link|comptime#},
7521+
If {#syntax#}operand{#endsyntax#} is a {#link|comptime#}-known integer,
75187522
the return type is {#syntax#}comptime_int{#endsyntax#}.
7519-
Otherwise, the return type is an unsigned integer with the minimum number
7523+
Otherwise, the return type is an unsigned integer or vector of unsigned integers with the minimum number
75207524
of bits that can represent the bit count of the integer type.
75217525
</p>
75227526
<p>
7523-
If {#syntax#}integer{#endsyntax#} is zero, {#syntax#}@ctz{#endsyntax#} returns
7527+
If {#syntax#}operand{#endsyntax#} is zero, {#syntax#}@ctz{#endsyntax#} returns
75247528
the bit width of integer type {#syntax#}T{#endsyntax#}.
75257529
</p>
75267530
{#see_also|@clz|@popCount#}

0 commit comments

Comments
 (0)