.squareRoot()
func hypotenuse(_ a: Double, _ b: Double) -> Double {
return (a * a + b * b).squareRoot()
}Swift โฉ Numbers and Basic Values โฉ Numeric Protocols โฉ FloatingPoint
Last updated
Was this helpful?
func hypotenuse(_ a: Double, _ b: Double) -> Double {
return (a * a + b * b).squareRoot()
}Swift โฉ Numbers and Basic Values โฉ Numeric Protocols โฉ FloatingPoint
Last updated
Was this helpful?
Was this helpful?