Skip to content

Instantly share code, notes, and snippets.

@jutikorn
Last active July 22, 2017 06:38
Show Gist options
  • Save jutikorn/451a6d68f455293f37155da9c6f95381 to your computer and use it in GitHub Desktop.
Save jutikorn/451a6d68f455293f37155da9c6f95381 to your computer and use it in GitHub Desktop.
factorial
fun factorial(num: Double): Double {
when (num) {
1.0 ->
return num
else ->
return factorial(num - 1) * num
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment