diff --git a/doc/go_faq.html b/doc/go_faq.html index 50108c075b..905bf9c9a3 100644 --- a/doc/go_faq.html +++ b/doc/go_faq.html @@ -1262,11 +1262,17 @@ size of value should use an explicitly sized type, like int64. Prior to Go 1.1, the 64-bit Go compilers (both gc and gccgo) used a 32-bit representation for int. As of Go 1.1 they use a 64-bit representation. +

+ +

On the other hand, floating-point scalars and complex -numbers are always sized: float32, complex64, -etc., because programmers should be aware of precision when using -floating-point numbers. -The default size of a floating-point constant is float64. +types are always sized (there are no float or complex basic types), +because programmers should be aware of precision when using floating-point numbers. +The default type used for an (untyped) floating-point constant is float64. +Thus foo := 3.0 declares a variable foo of type float64. +For a float32 variable initialized by a constant, the variable type must be specified explicitly +in the variable declaration var foo float32 = 3.0, or the constant must be given a +type with a conversion as in foo := float32(3.0).