Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift ui square root

func hypotenuse(_ a: Double, _ b: Double) -> Double {
    return (a * a + b * b).squareRoot()
}

let (dx, dy) = (3.0, 4.0)
let distance = hypotenuse(dx, dy)
// distance == 5.0
Source by developer.apple.com #
 
PREVIOUS NEXT
Tagged: #Swift #ui #square #root
ADD COMMENT
Topic
Name
4+6 =