Easiest way to find Square Root in Swift?

前端 未结 6 1851
小鲜肉
小鲜肉 2021-02-18 22:00

I have been trying to figure out how to programmatically find a square root of a number in Swift. I am looking for the simplest possible way to accomplish with as little code ne

6条回答
  •  情歌与酒
    2021-02-18 22:12

    Note that sqrt() will require the import of at least one of:

    • UIKit
    • Cocoa
      • You can just import Darwin instead of the full Cocoa
    • Foundation

提交回复
热议问题