go-tour/type-conversions.go

14 lines
187 B
Go
Raw Permalink Normal View History

2020-02-05 03:44:36 +00:00
package main
import (
"fmt"
"math"
)
func main() {
var x, y int = 3, 4
var f float64 = math.Sqrt(float64(x*x + y*y))
var z uint = uint(f)
fmt.Println(x, y, z)
}