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 210 views
1 answer 189 views
1 answer 180 views
1 answer 183 views
1 answer 185 views
1 answer 159 views
159 views asked May 7, 2019 by avibootz
1 answer 192 views
192 views asked May 7, 2019 by avibootz
...