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 209 views
1 answer 189 views
1 answer 180 views
1 answer 182 views
1 answer 184 views
1 answer 158 views
158 views asked May 7, 2019 by avibootz
1 answer 191 views
191 views asked May 7, 2019 by avibootz
...