There have been changes in Swift 3 for Xcode 8 beta 6, and now I cannot declare my operator for power, as I did before:
infix operator ^^ { } public func ^^ (radix: Double, power: Double) -> Double { return pow((radix), (power)) }
I read a little about it and there is a new change introduced in Xcode 8 beta 6
From this, I assume that I should declare a priority group and use it for my statement as follows:
precedencegroup ExponentiativePrecedence {} infix operator ^^: ExponentiativePrecedence public func ^^ (radix: Double, power: Double) -> Double { return pow((radix), (power)) }
Am I going in the right direction to do this job? What should I put inside {} priority groups?
My ultimate goal is to be able to perform operations with a simple operator in swift, for example:
10 ^^ -12 10 ^^ -24
operator-precedence swift swift3 xcode8-beta6
gbdavid Aug 24 '16 at 6:46 2016-08-24 06:46
source share