From: Robert Griesemer Date: Wed, 31 Aug 2016 00:09:30 +0000 (-0700) Subject: doc: more tweaks to the FAQ X-Git-Tag: go1.8beta1~1550 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6ebacf18a5769d071f467fae455a142a964a43da;p=gostls13.git doc: more tweaks to the FAQ Change-Id: I0a3726f841122643bd1680ef6bd450c2039f362b Reviewed-on: https://go-review.googlesource.com/28213 Reviewed-by: Rob Pike --- diff --git a/doc/go_faq.html b/doc/go_faq.html index 905bf9c9a3..de334ef197 100644 --- a/doc/go_faq.html +++ b/doc/go_faq.html @@ -1269,10 +1269,19 @@ On the other hand, floating-point scalars and complex 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). +Thus foo := 3.0 declares a variable foo +of type float64. +For a float32 variable initialized by an (untyped) constant, the variable type +must be specified explicitly in the variable declaration: +

+ +
+var foo float32 = 3.0
+
+ +

+Alternatively, the constant must be given a type with a conversion as in +foo := float32(3.0).