]> Cypherpunks repositories - gostls13.git/commit
go spec: constant divisors must not be zero
authorRobert Griesemer <gri@golang.org>
Fri, 19 Oct 2012 17:12:09 +0000 (10:12 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 19 Oct 2012 17:12:09 +0000 (10:12 -0700)
commitddddd39fc8b7ab073044e0fe8ad7c0eb912758b9
treec043b28384d916861e4c10ea5242cbe56e1d55eb
parent3bde00033b8d1ff7c494d10b1343178c32abb7ad
go spec: constant divisors must not be zero

Both gc and gccgo always checked this for constant
expressions but the spec only mentions run-time
exceptions.

This CL also requires that constant divisors
must not be zero in non-constant integer expressions:
This is consistent with the spirit of the most
recent changes and it is consistent with constant
expressions. We don't want to specify the effect for
non-integer expressions (f/0.0 where f is a float or
complex number) because there the result f/g is not
further specified if a non-constant g is 0.

R=r, rsc, iant, ken, andybalholm, iant
CC=golang-dev
https://golang.org/cl/6710045
doc/go_spec.html