Hi,
does this should work ?

package main

import (
    "fmt"
)

func main() {
    const (
        c = 2
        z = 3.3
        y = c * z
        x = int(y) // or x int = y
    )

    fmt.Println(x)
}


it does not compile with error: 
constant 6.6 truncated to integer

https://play.golang.org/p/f-Q6XSvvcrM

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/736e8b03-d38f-4ec4-adc8-fcb77e0cda7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to