authorgravatar for eleanor@eleanor-nb.comEleanor Bartle <eleanor@eleanor-nb.com> 2020-12-19 00:04:03+11:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2020-12-23 17:05:37+02:00
log49ca51fc3ac35ee3ab25cdad9747c9c0719ffe5e
tree6168be7953ad4d7ddde818b0b94588c475eb8e98
parentca282184ae4f02aa1eec8cf1301df89accbb4e1b

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 `/`.

1 files changed, 4 insertions(+), 4 deletions(-)

doc/langref.html.in+4-4
......@@ -1300,10 +1300,10 @@ a /= b{#endsyntax#}</pre></td>
13001300 <li>Can cause {#link|overflow|Default Operations#} for integers.</li>
13011301 <li>Can cause {#link|Division by Zero#} for integers.</li>
13021302 <li>Can cause {#link|Division by Zero#} for floats in {#link|FloatMode.Optimized Mode|Floating Point Operations#}.</li>
1303 <li>For non-compile-time-known signed integers, must use
1303 <li>Signed integer operands must be comptime-known and positive. In other cases, use
13041304 {#link|@divTrunc#},
13051305 {#link|@divFloor#}, or
1306 {#link|@divExact#} instead of {#syntax#}/{#endsyntax#}.
1306 {#link|@divExact#} instead.
13071307 </li>
13081308 <li>Invokes {#link|Peer Type Resolution#} for the operands.</li>
13091309 </ul>
......@@ -1325,9 +1325,9 @@ a %= b{#endsyntax#}</pre></td>
13251325 <ul>
13261326 <li>Can cause {#link|Division by Zero#} for integers.</li>
13271327 <li>Can cause {#link|Division by Zero#} for floats in {#link|FloatMode.Optimized Mode|Floating Point Operations#}.</li>
1328 <li>For non-compile-time-known signed integers, must use
1328 <li>Signed or floating-point operands must be comptime-known and positive. In other cases, use
13291329 {#link|@rem#} or
1330 {#link|@mod#} instead of {#syntax#}%{#endsyntax#}.
1330 {#link|@mod#} instead.
13311331 </li>
13321332 <li>Invokes {#link|Peer Type Resolution#} for the operands.</li>
13331333 </ul>