```
extension Array where Element: Numeric {
    func closest(to givenValue: Element) -> Element {
        let sorted = self.sorted(by: <)

        let over = sorted.first(where: { $0 >= givenValue })!
        let under = sorted.last(where: { $0 <= givenValue })!

        let diffOver = over - givenValue
        let diffUnder = givenValue - under

        return (diffOver < diffUnder) ? over : under
    }
}

```

In line 3 of this example code, Xcode gives me the incomprehensible error message `Ambiguous reference to member '<'`, along with this great list:

[![list of like a dozen "Found this candidate" entries](https://i.stack.imgur.com/WqEBy.png)](https://i.stack.imgur.com/WqEBy.png)

What am I supposed to do here? I just want this array to get sorted.