[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

Re: [swift-users] Experimenting with conditional conformances

2017-11-28 Thread Antonino Ficarra via swift-users
There are different algorithms for Element==CGPoint, Element==[CGPoint], Element==[AreaPoint], etc… Your second suggestion work: protocol Inertial { funcconvexHull( _ t:AffineTransform? ) -> [CGPoint] funcarea( _ t:AffineTransform? ) -> CGFloat func

[swift-users] Experimenting with conditional conformances

2017-11-28 Thread Antonino Ficarra via swift-users
I’have a protocol: protocol Inertial { funcconvexHull( _ t:AffineTransform? ) -> [CGPoint] funcarea( _ t:AffineTransform? ) -> CGFloat funcfirstOrderMomentums( _ t:AffineTransform? ) -> (x:CGFloat,y:CGFloat) funcsecondOrderMomentums( _

Re: [swift-users] A somewhat stupid question about protocol conformances

2017-11-25 Thread Antonino Ficarra via swift-users
need to support that functionality. > > Double check if the code compiles, I wrote it on my iPhone, but you get the > idea now. > > -- > Adrian Zubarev > Sent with Airmail > Am 25. November 2017 um 07:40:25, Antonino Ficarra via swift-users > (swift-users@swift.or

[swift-users] A somewhat stupid question about protocol conformances

2017-11-24 Thread Antonino Ficarra via swift-users
In this code example: import Foundation protocol AreaProtocol { funcarea() -> CGFloat // implemented in protocol extension funcvolume( height:CGFloat ) -> CGFloat // } extension AreaProtocol { funcvolume( height:CGFloat ) ->

[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

[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

[swift-users] Swift support for long double/Float80 math functions?

2016-07-02 Thread Antonino Ficarra via swift-users
How make Float80 bridge with long double math.h c functions? I resorts to use some orrible hacks like these: // in f80.h extern void sqrt_f80( void *result, const void *v ); extern void pow_f80( void *result, const void *v, const void *e ); ... // in f80.c void sqrt_f80( void *result, const