[swift-evolution] [Accepted] SE-0104: Protocol-oriented integers

Nevin Brackett-Rozinsky nevin.brackettrozinsky at gmail.com
Thu Mar 2 12:00:08 CST 2017


One use-case that springs immediately to mind is creating ranges of
magnitudes. It is not sufficient to use abs() because that returns the same
type which may not be comparable.

Also, a fairly common operation on complex numbers (or indeed any
metric space) is to see if two values are within distance d of each other.
In other words, to check whether the magnitude of their difference is less
than d. This again requires comparability of magnitudes.

Nevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170302/86b9f910/attachment.html>


More information about the swift-evolution mailing list