Hello golang-nuts,

Here are two code snippets with operations on different types. One with 
constants and another one with variables. The first one works, the second 
one doesn't. Why is it like this? Logically both code snippets shouldn't 
work:

https://play.golang.org/p/eqNJootZ3a

package main

import (
    "fmt"
)

func main() {
    const (
        c = 6
        r = 0.001
    )
    fmt.Println(c * r)
}

https://play.golang.org/p/z0xEAy56Tg

package main

import (
    "fmt"
)

func main() {

    c := 6
    r := 0.001

    fmt.Println(c * r)
}

Thanks
Alex

-- 
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