Re: [swift-users] Why inout protocol parameter in function work with strange

2017-05-26 Thread Zhao Xin via swift-users
Try this. protocol Position { var x: Double { get set } } struct Car: Position { var x: Double } func move(item: inout T) where T:Position { item.x += 1 } var car = Car(x: 50) move(item: &car) car.x // 51 Zhaoxin On Sat, May 27, 2017 at 12:35 AM, Guillaume Lessard vi

Re: [swift-users] Why inout protocol parameter in function work with strange

2017-05-26 Thread Guillaume Lessard via swift-users
In your example, the compiler needs a parameter of type Position. Car is a type of Position, but they are not interchangeable. See below: > On May 26, 2017, at 00:33, Седых Александр via swift-users > wrote: > > protocol Position { > var x: Double { getset } > } > > struct Car: Position

Re: [swift-users] Unsupported Float80 math functions and min/max behavior with Nan

2017-05-26 Thread Alex Blewitt via swift-users
> On 26 May 2017, at 11:01, Antonino Ficarra via swift-users > wrote: > > - Why Swift continues to not support Float80 math functions? > Example: > > print("\( log( Float( 1.0 ) ) )") > print("\( log( Double( 1.0 ) ) )") > // print("\( log( Float80( 1.0 ) ) )")// don’t compile and logl

[swift-users] Unsupported Float80 math functions and min/max behavior with Nan

2017-05-26 Thread Antonino Ficarra via swift-users
- Why Swift continues to not support Float80 math functions? Example: print("\( log( Float( 1.0 ) ) )") print("\( log( Double( 1.0 ) ) )") // print("\( log( Float80( 1.0 ) ) )") // don’t compile and logl is unavailable - Why min and max continue to not act like fmin and fmax (IEEE 754 standard)?

[swift-users] Unsupported Float80 math functions and min/max behavior with Nan

2017-05-26 Thread Antonino Ficarra via swift-users
- Why Swift continues to not support Float80 math functions? Example: print("\( log( Float( 1.0 ) ) )") print("\( log( Double( 1.0 ) ) )") // print("\( log( Float80( 1.0 ) ) )") // don’t compile and logl is unavailable - Why min and max continue to not act like fmin and fmax (IEEE 754 standard)?