Consider the following code written in go:
package main
import "fmt"
func main() {
const pi float64 = 22 / 7
fmt.Println("pi value", pi)
}
here the value of pi
is 3
. The question is why is the value losing precision even though it is of type float64
?