On Sun, Sep 11, 2016 at 4:33 AM, Ilya Kostarev <uvelichi...@gmail.com> wrote:
>
> On 09/10/2016 09:18 PM, Manlio Perillo wrote:
>
> Il giorno giovedì 8 settembre 2016 17:31:55 UTC+2, Uvelichitel ha scritto:
>>
>>
>>      func main() {
>>          const x, y = 5, 3
>>          var f float32 = x / y
>>          fmt.Println(f)
>>      }
>>
>
> In your case the default type of x and y are integer constants.
>
>
> Manlio
>
> Hi Manio.
> Things are not so simple, say
>          const x, y = int 5, 3   / /explicitly
>          var f float32 = x / y
> just doesn't  compile with an  error  "cannot use x / y (type int) as type
> float32 in assignment"

That example doesn't build.  But I think that all your questions are
answered at https://blog.golang.org/constants .

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to