Sqrt in Go

Posted by GoDoc
Public (Editable by Users)

Sqrt returns the square root of x.

Go
Edit
package main

import (
	"fmt"
	"math"
)

func main() {
	const (
		a = 3
		b = 4
	)
	c := math.Sqrt(a*a + b*b)
	fmt.Printf("%.1f", c)
}