How to use square root function (sqrt) in Go

1 Answer

0 votes
package main

import (
	"fmt"
	"math"
)

func main() {
	fmt.Printf("%g\n", math.Sqrt(9))
	fmt.Printf("%g\n", math.Sqrt(12))
	fmt.Printf("%g\n", math.Sqrt(6))
}


/*
run:

3
3.4641016151377544
2.449489742783178

*/

 



answered Feb 29, 2020 by avibootz

Related questions

1 answer 212 views
1 answer 195 views
1 answer 185 views
1 answer 185 views
1 answer 187 views
1 answer 160 views
160 views asked May 7, 2019 by avibootz
1 answer 196 views
196 views asked May 7, 2019 by avibootz
...