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 318 views
1 answer 274 views
1 answer 280 views
1 answer 276 views
1 answer 295 views
1 answer 256 views
256 views asked May 7, 2019 by avibootz
1 answer 285 views
285 views asked May 7, 2019 by avibootz
...