Currently, the FloatingPoint protocol does not conform to
ExpressibleByFloatLiteral, whereas BinaryFloatingPoint does.

The only explanation I can find for this is a brief comment from Steve Canon
<https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160425/015691.html>
during the review of SE-0067 (Enhanced Floating Point Protocols)
<https://github.com/apple/swift-evolution/blob/master/proposals/0067-floating-point-protocols.md>
:


On Mon, Apr 25, 2016 at 1:32 PM, Stephen Canon via swift-evolution
> <swift-evolution at swift.org> wrote:
>
> On Apr 23, 2016, at 8:53 PM, Brent Royal-Gordon via swift-evolution
>> <swift-evolution at swift.org> wrote:
>>
>> Any reason why FloatLiteralConvertible isn't on FloatingPoint?
>
>
> It doesn’t make sense for non-radix-2 types; you would change bases
> multiple times.



I don’t have Steve’s level of floating-point expertise, but from a
conceptual standpoint Swift protocols encapsulate semantics and, unless I
am quite mistaken, semantically a floating-point number *can* be expressed
as a floating-point literal.

So, what exactly is the problem preventing such a conformance, and what
would be required to fix it? Do we need to revamp how numeric literals are
handled, eg. to allow arbitrary-precision integers and base-agnostic floats?

Nevin
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to