Last active
August 29, 2015 14:18
-
-
Save joanmolinas/810849c2ed810275a3fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
infix operator ** { associativity left precedence 160 } | |
postfix operator ** {} | |
func ** (lhs: Double, rhs: Double) -> Double { | |
return pow(lhs, rhs) | |
} | |
postfix func **(rhs : Int) -> Int { | |
return rhs * rhs | |
} | |
2/4 ** -4 //OUTPUT -> 512.0 | |
5** //OUTPUT -> 25 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment