extension String {
var expression: NSExpression {
return NSExpression(format: self)
}
}
infix operator ^^
func ^^ (radix: Int, power: Int) -> Double {
return Double(pow(Double(radix), Double(power)))
}
How can I add my infix operator in the NSExpression
?
I want to add ^^
as the power calculation operator in the NSExpression
.