aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorEleanor Bartle <eleanor@eleanor-nb.com>2020-12-19 00:04:03 +1100
committerVeikka Tuominen <git@vexu.eu>2020-12-23 17:05:37 +0200
commit49ca51fc3ac35ee3ab25cdad9747c9c0719ffe5e (patch)
tree6168be7953ad4d7ddde818b0b94588c475eb8e98 /doc
parentca282184ae4f02aa1eec8cf1301df89accbb4e1b (diff)
downloadzig-49ca51fc3ac35ee3ab25cdad9747c9c0719ffe5e.tar.gz
zig-49ca51fc3ac35ee3ab25cdad9747c9c0719ffe5e.zip
Clarify condusing wording regarding `%` and `/`
Previous wording made it seem like any signed or floating-point value would be allowed at comptime, whereas negative values do not work with `%`, and negative integers do not work with `/`.
Diffstat (limited to 'doc')
-rw-r--r--doc/langref.html.in8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in
index 4da04f41e8..7c8d1c6662 100644
--- a/doc/langref.html.in
+++ b/doc/langref.html.in
@@ -1300,10 +1300,10 @@ a /= b{#endsyntax#}</pre></td>
<li>Can cause {#link|overflow|Default Operations#} for integers.</li>
<li>Can cause {#link|Division by Zero#} for integers.</li>
<li>Can cause {#link|Division by Zero#} for floats in {#link|FloatMode.Optimized Mode|Floating Point Operations#}.</li>
- <li>For non-compile-time-known signed integers, must use
+ <li>Signed integer operands must be comptime-known and positive. In other cases, use
{#link|@divTrunc#},
{#link|@divFloor#}, or
- {#link|@divExact#} instead of {#syntax#}/{#endsyntax#}.
+ {#link|@divExact#} instead.
</li>
<li>Invokes {#link|Peer Type Resolution#} for the operands.</li>
</ul>
@@ -1325,9 +1325,9 @@ a %= b{#endsyntax#}</pre></td>
<ul>
<li>Can cause {#link|Division by Zero#} for integers.</li>
<li>Can cause {#link|Division by Zero#} for floats in {#link|FloatMode.Optimized Mode|Floating Point Operations#}.</li>
- <li>For non-compile-time-known signed integers, must use
+ <li>Signed or floating-point operands must be comptime-known and positive. In other cases, use
{#link|@rem#} or
- {#link|@mod#} instead of {#syntax#}%{#endsyntax#}.
+ {#link|@mod#} instead.
</li>
<li>Invokes {#link|Peer Type Resolution#} for the operands.</li>
</ul>