In Swift we can use pow(::)
for making power of any number. For Example if we need 2 power 3 –
import Foundation
let a = 2.0
let b = 3.0
let output = pow(a,b)// prints 8
Further you can also typeCaste to Int
as let output = Int(pow(a,b))// prints 8
Remember to add import Foundation
for get rid of compile time error.