]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.1.html: document division by zero change from CL 6710045
authorRuss Cox <rsc@golang.org>
Wed, 30 Jan 2013 17:23:36 +0000 (09:23 -0800)
committerRuss Cox <rsc@golang.org>
Wed, 30 Jan 2013 17:23:36 +0000 (09:23 -0800)
I am still not convinced this is a change we should make, but at least
documenting it will keep us from forgetting it as we get closer to Go 1.1.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7226064

doc/go1.1.html

index 287f007fc46a30f81d48a386d07079af8ce2c097..32639ecbdbc7797395af5413776805adf3a7ebd6 100644 (file)
@@ -14,6 +14,23 @@ TODO
 
 TODO
 
+<h3 id="divzero">Integer division by zero</h3>
+
+<p>
+In Go 1, integer division by a constant zero produced a runtime panic:
+</p>
+
+<pre>
+func f(x int) int {
+       return x/0
+}
+</pre>
+
+<p>
+In Go 1.1, an integer division by constant zero is not a legal program, so it is a compile-time error.
+</p>
+
+
 <h2 id="impl">Changes to the implementations and tools</h2>
 
 TODO: more