From 4f263a48d3b19ca06a277c5fef78df55e9a92b10 Mon Sep 17 00:00:00 2001 From: nobishino Date: Sat, 27 Feb 2021 14:20:11 +0900 Subject: [PATCH] spec: clarify that signed integers are permitted as shift counts In Go1.13 and above, signed integers are permitted as shift counts as long as they are non-negative. However, the list in the "Arithmetic operators" section says shift operators accept "unsigned integer" as of right operands. Replacing this to "integer >= 0" would reduce the misunderstanding that shift operators permit only unsigned integers. Go1.13 Release Notes: https://golang.org/doc/go1.13 --- doc/go_spec.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index 2a1322fb0f..39617cf524 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -3681,8 +3681,8 @@ The bitwise logical and shift operators apply to integers only. ^ bitwise XOR integers &^ bit clear (AND NOT) integers -<< left shift integer << unsigned integer ->> right shift integer >> unsigned integer +<< left shift integer << integer >= 0 +>> right shift integer >> integer >= 0