go - Convert an integer to a float number in Golang -
how convert integer value float64 type?
i tried
float(integer_value) but not work. , can't find package on golang.org.
how float64 values integer values?
there no float type. looks want float64. use float32 if need single-precision floating point value.
package main import "fmt" func main() { := 5 f := float64(i) fmt.printf("f %f\n", f) }
Comments
Post a Comment