mirror of
https://github.com/golang/go
synced 2024-11-11 22:30:21 -07:00
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
This commit is contained in:
parent
47e5266a22
commit
80a87a99cc
@ -1,6 +1,6 @@
|
||||
<!--{
|
||||
"Title": "The Go Programming Language Specification",
|
||||
"Subtitle": "Version of January 2, 2013",
|
||||
"Subtitle": "Version of January 6, 2013",
|
||||
"Path": "/ref/spec"
|
||||
}-->
|
||||
|
||||
@ -3027,7 +3027,7 @@ int64 -9223372036854775808
|
||||
<p>
|
||||
If the divisor is a <a href="#Constants">constant</a>, it must not be zero.
|
||||
If the divisor is zero at run time, a <a href="#Run_time_panics">run-time panic</a> 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:
|
||||
</p>
|
||||
|
Loading…
Reference in New Issue
Block a user