# What happened to squareRoot()?

**URL:** <https://forums.swift.org/t/what-happened-to-squareroot/77947>\
**Category:** Using Swift\
**Created:** [February 18, 2025, 8:26pm UTC](https://forums.swift.org/t/what-happened-to-squareroot/77947 "2025-02-18T20:26:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![karlgoethebier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/karlgoethebier/32/31004_2.png) [@karlgoethebier](https://forums.swift.org/u/karlgoethebier)\
**Post date:** [February 18, 2025, 8:26pm UTC](https://forums.swift.org/t/what-happened-to-squareroot/77947/1 "2025-02-18T20:26:11Z")

</div>

Strange observation:

```swift
// import func Foundation.sqrt                                                                   
let x = 2.0
// print(sqrt(x))                                                                                
print(x.squareRoot())

```

This yields:

```swift
0/1] Planning build
Building for debugging...
[0/4] Write swift-version--53D108475B68636.txt
[2/5] Emitting module actorism
error: link command failed with exit code 1 (use -v to see invocation)
/home/karl/swift/swift-6.0.3-RELEASE-ubuntu22.04/usr/lib/swift/shims/LibcShims.h:155: error: undefined reference to 'sqrt'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[3/4] Linking actorism

```

But this compiles and prints the result twice:

```swift
import func Foundation.sqrt
let x = 2.0
print(sqrt(x))
print(x.squareRoot())

```

Thanks for any hint.

---

<div class="post-metadata">

**Author:** ![bbrk24](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/bbrk24/32/27370_2.png) [@bbrk24](https://forums.swift.org/u/bbrk24)\
**Post date:** [February 18, 2025, 9:29pm UTC](https://forums.swift.org/t/what-happened-to-squareroot/77947/2 "2025-02-18T21:29:13Z")

</div>

What build settings are you using? I'm not seeing the same behavior in the REPL or [SwiftFiddle](https://swiftfiddle.com/3juzorpgjbb4xbfkotqvtfnbae).

---

<div class="post-metadata">

**Author:** ![karlgoethebier](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/karlgoethebier/32/31004_2.png) [@karlgoethebier](https://forums.swift.org/u/karlgoethebier)\
**Post date:** [February 19, 2025, 5:56am UTC](https://forums.swift.org/t/what-happened-to-squareroot/77947/3 "2025-02-19T05:56:13Z")

</div>

You mean what `swift build -v` shows?

BTW:

```swift
swift repl
Welcome to Swift version 6.0.3 (swift-6.0.3-RELEASE).
Type :help for assistance.
  1> 2.squareRoot()
$R0: Double = 1.4142135623730951
  2>  

```
