Skip to content

Instantly share code, notes, and snippets.

@CaglarGonul
Last active December 15, 2015 00:29
Show Gist options
  • Save CaglarGonul/5173501 to your computer and use it in GitHub Desktop.
Save CaglarGonul/5173501 to your computer and use it in GitHub Desktop.
simple sum scala
def sum(f:Int=>Int)(a:Int,b:Int):Int ={
if(a>b) 0
else f(a) + sum(f)(a+1,b)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment