mirror of
https://github.com/golang/go
synced 2024-11-21 14:54:40 -07:00
go spec: adjust language for constant typing
Fixes #1421. R=r, rsc, iant, ken2 CC=golang-dev https://golang.org/cl/4039042
This commit is contained in:
parent
36d658d7d6
commit
dfc5bb5ff6
@ -561,7 +561,7 @@ or <a href="#Conversions">conversion</a>, or implicitly when used in a
|
|||||||
<a href="#Assignments">assignment</a> or as an
|
<a href="#Assignments">assignment</a> or as an
|
||||||
operand in an <a href="#Expressions">expression</a>.
|
operand in an <a href="#Expressions">expression</a>.
|
||||||
It is an error if the constant value
|
It is an error if the constant value
|
||||||
cannot be accurately represented as a value of the respective type.
|
cannot be represented as a value of the respective type.
|
||||||
For instance, <code>3.0</code> can be given any integer or any
|
For instance, <code>3.0</code> can be given any integer or any
|
||||||
floating-point type, while <code>2147483648.0</code> (equal to <code>1<<31</code>)
|
floating-point type, while <code>2147483648.0</code> (equal to <code>1<<31</code>)
|
||||||
can be given the types <code>float32</code>, <code>float64</code>, or <code>uint32</code> but
|
can be given the types <code>float32</code>, <code>float64</code>, or <code>uint32</code> but
|
||||||
|
Loading…
Reference in New Issue
Block a user