How to use pow with integers in Swift

1 Answer

0 votes
import Foundation

let x:Int = 2
let y:Int = 4

let result = Int(pow(Double(x), Double(y)))

print(result)



/*
run:
    
16
    
*/

 



answered Oct 19, 2021 by avibootz
...