on Mon Apr 11 2016, Ross O'Brien <[email protected]> wrote:

> 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,

The upcoming proposals for integer and floating point protocols have a
common type called Arithmetic that serves this purpose.

>
>
> On Mon, Apr 11, 2016 at 4:55 PM, Joanna Carter via swift-evolution
> <[email protected]> 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
>     [email protected]
>     https://lists.swift.org/mailman/listinfo/swift-evolution
>
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

-- 
Dave

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to