DevBits
Home
Atlas
Play
About
Sign up
Log in
All
Go
Math
Trigonometry
Compute Hypotenuse
Compute Hypotenuse in Go
Compute Hypotenuse in Go
Posted by
yhuang
Public (Editable by Users)
Language
Go
Dependencies
import "fmt"
import "math"
fmt.Printf()
math.Hypot()
Run
Go 1.15.5
Play
Copy
Copy To
Official Go Playground
Expand
Fork
Edit
main.go
package main import ( "fmt" "math" ) func main() { c := math.Hypot(3, 4) fmt.Printf("%.1f", c) }
Stdout
Stderr