Skip to content

Instantly share code, notes, and snippets.

@rbobillot
Last active August 29, 2015 14:20
Show Gist options
  • Save rbobillot/2c7ccd28ac5a3dd369b6 to your computer and use it in GitHub Desktop.
Save rbobillot/2c7ccd28ac5a3dd369b6 to your computer and use it in GitHub Desktop.
import scala.language.postfixOps
implicit class factorial(n:Int) {
def ! = (1 to n).foldLeft(BigInt(1))(_ * _)
}
println( (5!) * (5!) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment