Skip to content

all: rename @maximum to @max and @minimum to @min #13055

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions doc/langref.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -8977,15 +8977,15 @@ test "integer cast panic" {
</p>
{#header_close#}

{#header_open|@maximum#}
<pre>{#syntax#}@maximum(a: T, b: T) T{#endsyntax#}</pre>
{#header_open|@max#}
<pre>{#syntax#}@max(a: T, b: T) T{#endsyntax#}</pre>
<p>
Returns the maximum value of {#syntax#}a{#endsyntax#} and {#syntax#}b{#endsyntax#}. This builtin accepts integers, floats, and vectors of either. In the latter case, the operation is performed element wise.
</p>
<p>
NaNs are handled as follows: if one of the operands of a (pairwise) operation is NaN, the other operand is returned. If both operands are NaN, NaN is returned.
</p>
{#see_also|@minimum|Vectors#}
{#see_also|@min|Vectors#}
{#header_close#}

{#header_open|@memcpy#}
Expand Down Expand Up @@ -9025,15 +9025,15 @@ mem.copy(u8, dest[0..byte_count], source[0..byte_count]);{#endsyntax#}</pre>
mem.set(u8, dest, c);{#endsyntax#}</pre>
{#header_close#}

{#header_open|@minimum#}
<pre>{#syntax#}@minimum(a: T, b: T) T{#endsyntax#}</pre>
{#header_open|@min#}
<pre>{#syntax#}@min(a: T, b: T) T{#endsyntax#}</pre>
<p>
Returns the minimum value of {#syntax#}a{#endsyntax#} and {#syntax#}b{#endsyntax#}. This builtin accepts integers, floats, and vectors of either. In the latter case, the operation is performed element wise.
</p>
<p>
NaNs are handled as follows: if one of the operands of a (pairwise) operation is NaN, the other operand is returned. If both operands are NaN, NaN is returned.
</p>
{#see_also|@maximum|Vectors#}
{#see_also|@max|Vectors#}
{#header_close#}

{#header_open|@wasmMemorySize#}
Expand Down
4 changes: 2 additions & 2 deletions lib/compiler_rt/float_to_int.zig
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ pub inline fn floatToInt(comptime I: type, a: anytype) I {
switch (@typeInfo(I).Int.signedness) {
.unsigned => {
if (negative) return 0;
if (@intCast(c_uint, exponent) >= @minimum(int_bits, max_exp)) return math.maxInt(I);
if (@intCast(c_uint, exponent) >= @min(int_bits, max_exp)) return math.maxInt(I);
},
.signed => if (@intCast(c_uint, exponent) >= @minimum(int_bits - 1, max_exp)) {
.signed => if (@intCast(c_uint, exponent) >= @min(int_bits - 1, max_exp)) {
return if (negative) math.minInt(I) else math.maxInt(I);
},
}
Expand Down
Loading