What is the CURRENT syntax for pow() and sqrt Xcode 11.3.1?? I tried researching and can’t get an answer.
After googling “square root Swift” and “to the power of swift”
I found the documentation for both these functions
https://developer.apple.com/documentation/swift/double/2885715-squareroot
https://developer.apple.com/documentation/foundation/1779833-pow
After doing that I ran a playground, and they both function as expected
Thanks. Looks like my search was too vague…
If you’re trying to find syntax for something always add “swift” in your search
I found out its working in playground
with this form:
pow(2, 2)
But in an actual project even after using import UIkit, still not working and I’m receiving this error
Ambiguous use of ‘pow’
then I changed it to this: pow(2.0, 2.0) It was working perfectly!
Hint: You do not need to import UIKIT or Foundation