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

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -