How to initialize a slice of float64 values in Go

1 Answer

0 votes
package main 
  
import ( 
    "fmt"
) 
    
func main() { 
    slice := []float64{2.2, 3.14, 13.455, 13.456, 19.7, 24.21} 
 
    fmt.Println(slice)
} 
  
   
  
    
/*
run:
     
[2.2 3.14 13.455 13.456 19.7 24.21]
 
*/

 



answered Aug 18, 2020 by avibootz

Related questions

1 answer 168 views
1 answer 164 views
164 views asked Aug 17, 2020 by avibootz
1 answer 173 views
1 answer 155 views
1 answer 82 views
82 views asked Nov 10, 2024 by avibootz
...