Re: [swift-users] FloatingPoint/BinaryFloatingPoint protocol and concrete FloatingPoint types

2017-12-03 Thread David Sweeris via swift-users
Sorry, mostly I was just commenting on what I now see was an incorrect interpretation of the “// but something actually requiring high precision ...” comment in your example code. I’d read it as... you know, I’m not sure what I’d though it said... I think something that implied the code would

Re: [swift-users] FloatingPoint/BinaryFloatingPoint protocol and concrete FloatingPoint types

2017-12-03 Thread Jens Persson via swift-users
I'm not sure what you mean David. That function was just part of my attempt at presenting a solution to Antonino's question (that particular function is from Antonino's code). Below is my solution to Antonino's problem again, including a perhaps clearer comment in that function: protocol

Re: [swift-users] FloatingPoint/BinaryFloatingPoint protocol and concrete FloatingPoint types

2017-12-01 Thread David Sweeris via swift-users
> On Dec 1, 2017, at 13:18, Jens Persson via swift-users > wrote: > > func maxPrecisionCalculation(input:Float80) -> Float80 { > return input // but something actually reauiring high precision ... > } AFAIK, Float80 is the high precision format on macOS (well,

Re: [swift-users] FloatingPoint/BinaryFloatingPoint protocol and concrete FloatingPoint types

2017-12-01 Thread Jens Persson via swift-users
protocol Float80Convertible : BinaryFloatingPoint { init(_ value: Float80) var float80: Float80 { get } } extension Double : Float80Convertible { var float80: Float80 { return Float80(self) } } extension Float : Float80Convertible { var float80: Float80 { return Float80(self) } }

[swift-users] FloatingPoint/BinaryFloatingPoint protocol and concrete FloatingPoint types

2017-11-29 Thread Antonino Ficarra via swift-users
Suppose that I have a generic function that makes a complex floating calculation with a generic floating point type. Suppose that calculation require the max floating point machine precision so: 1) I need to convert the generic floating point type to Float80 2) make the complex calculation with