Created
March 22, 2014 17:43
-
-
Save pedrofurla/9711330 to your computer and use it in GitHub Desktop.
Is this tailrec? Doesn't look to me
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
| @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