From 80a87a99cccc730980aae0b7b10c6e645869f755 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Sun, 6 Jan 2013 16:56:06 -0800 Subject: [PATCH] spec: Use "non-negative" instead of "positive" Replacing division-by-power-of-2 with right-shift is valid for zero too. R=gri CC=golang-dev https://golang.org/cl/7027049 --- doc/go_spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index ad3fa519b2..e54068a2d7 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -3027,7 +3027,7 @@ int64 -9223372036854775808

If the divisor is a constant, it must not be zero. If the divisor is zero at run time, a run-time panic occurs. -If the dividend is positive and the divisor is a constant power of 2, +If the dividend is non-negative and the divisor is a constant power of 2, the division may be replaced by a right shift, and computing the remainder may be replaced by a bitwise AND operation:

-- 2.48.1