[swift-evolution] [Re-Review] SE-0104: Protocol-oriented integers
David Sweeris
davesweeris at mac.com
Thu Feb 23 11:40:04 CST 2017
> On Feb 22, 2017, at 23:52, Karl Wagner via swift-evolution <swift-evolution at swift.org> wrote:
>
>
>>>>
>>>> Are there Number types which can’t be Comparable?
>>>
>>> Complex numbers. I believe `Number` is designed to allow a complex number type to conform.
>>>
>
> Magnitude could be comparable then. For vectors, matrices and complex numbers, “magnitude” typically refers to a scalar. I don’t think we need something broader than that.
Using magnitude for comparison leads to some decidedly odd places:
let x: Complex = 1
let y: Complex = -2
x < y // returns true
- Dave Sweeris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170223/2f5d2037/attachment.html>
More information about the swift-evolution
mailing list