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 208 views
1 answer 186 views
1 answer 176 views
1 answer 179 views
1 answer 182 views
1 answer 156 views
156 views asked May 7, 2019 by avibootz
1 answer 187 views
187 views asked May 7, 2019 by avibootz
...