aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authornobishino <nobishii11@gmail.com>2021-03-16 19:49:13 +0000
committerEmmanuel Odeke <emmanuel@orijtech.com>2021-03-16 19:51:31 +0000
commit13a0f7b50299f9ab40dad7c855539af65e34d132 (patch)
tree0e0eb9b1d90b7f4960838c460679a77584e1c116 /doc
parentd206ca5cac60ddff222a25e1dc96d6b0e96c21b5 (diff)
downloadgo-13a0f7b50299f9ab40dad7c855539af65e34d132.tar.gz
go-13a0f7b50299f9ab40dad7c855539af65e34d132.zip
spec: clarify that signed integers>=0 are permitted as shift counts
In Go1.13 and above, signed integers are permitted as shift counts as long as they are >=0. However, the comments in the "Arithmetic operators" section says shift operators accept "unsigned integer" as of right operands. Replacing this with "integer>=0" resolves the misunderstanding that shift operators permit only unsigned integers. Reference: Go1.13 Release Notes: https://golang.org/doc/go1.13 Change-Id: Icd3c7734d539ab702590e992a618c9251c653c37 GitHub-Last-Rev: 4f263a48d3b19ca06a277c5fef78df55e9a92b10 GitHub-Pull-Request: golang/go#44664 Reviewed-on: https://go-review.googlesource.com/c/go/+/297249 Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Reviewed-by: Robert Griesemer <gri@golang.org> Trust: Emmanuel Odeke <emmanuel@orijtech.com> Trust: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/go_spec.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/go_spec.html b/doc/go_spec.html
index 2a1322fb0f0..39617cf5241 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -1,6 +1,6 @@
<!--{
"Title": "The Go Programming Language Specification",
- "Subtitle": "Version of Feb 24, 2021",
+ "Subtitle": "Version of Mar 16, 2021",
"Path": "/ref/spec"
}-->
@@ -3681,8 +3681,8 @@ The bitwise logical and shift operators apply to integers only.
^ bitwise XOR integers
&amp;^ bit clear (AND NOT) integers
-&lt;&lt; left shift integer &lt;&lt; unsigned integer
-&gt;&gt; right shift integer &gt;&gt; unsigned integer
+&lt;&lt; left shift integer &lt;&lt; integer >= 0
+&gt;&gt; right shift integer &gt;&gt; integer >= 0
</pre>