Skip to content

Instantly share code, notes, and snippets.

@pedrofurla
Created March 22, 2014 17:43
Show Gist options
  • Select an option

  • Save pedrofurla/9711330 to your computer and use it in GitHub Desktop.

Select an option

Save pedrofurla/9711330 to your computer and use it in GitHub Desktop.
Is this tailrec? Doesn't look to me
@tailrec private def isEvenlyDivisible(i: Int, a: Int, b: Int): Boolean = {
if (i > b) true
else (a % i == 0) && isEvenlyDivisible(i+1, a, b)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment