Go Data Type int32 convert to float64

Description

Go Data Type int32 convert to float64

package main//from w ww .j a va  2 s  .  co  m

import (
  "fmt"
  "reflect"
)

func main() {
  var f32 float32 = 10.4242
  fmt.Println(reflect.TypeOf(f32))

  i32 := int32(f32)
  fmt.Println(reflect.TypeOf(i32))
  fmt.Println(i32)

  f64 := float64(i32)
  fmt.Println(reflect.TypeOf(f64))
}



PreviousNext

Related