swift2 中infix operator ** { associativity left precedence 160 } 设置associativity left就可以 ,swift3中怎么写
precedencegroup ComparativePrecedence{ //定义运算符优先级
associativity: right
higherThan: LogicalConjunctionPrecedence
}
infix operator ** : ComparativePrecedence
func **(x: Double, p:Double) -> Double{
return pow(x,p)
}
改成这样就可以了
改成这样就可以了