[swift-evolution] [swift-users] Replacement for NSNumber?

Ross O'Brien narrativium+swift at gmail.com
Mon Apr 11 11:04:55 CDT 2016


Your pointing to two mutually exclusive protocols proves the point. If I
want to write a generic function for a numerical type which can be added, I
can't just require that the type conforms to IntegerArithmeticType because
that excludes all the floating point types. Protocols for various numerical
functions, e.g. NumericalArithmeticType, would be handy,

On Mon, Apr 11, 2016 at 4:55 PM, Joanna Carter via swift-evolution <
swift-evolution at swift.org> wrote:

>
> > It’s inconvenient that structs can’t inherit, and so things like Int and
> Double aren’t known as numbers. Should there be a Number protocol that
> encompasses all things number-like?
>
> Taje a look at the IntegerType and FloatingPointType
>
> --
> Joanna Carter
> Carter Consulting
>
> (de mon iPhone)
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160411/64812537/attachment.html>


More information about the swift-evolution mailing list