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"
__
Ilya Kostarev
--
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.