Calculate power of a number

 Problem

I want to calculate the power of a number: X^Y.



 Recipe


// Set the number
let n = 4.0

// Get the power n^2
let pwr = pow(n,2)

print(pwr)

				


 Playground

Find answers here

Hi there! Ask Us a Question We are ready to help