Currently taking a class that\'s using Scala which I\'ve never used before, so the syntax and itself is new.
I\'m working on a simple division function but am runnin
For completeness, putting more idiomatic recursive definition here:
def div(m: Int, n: Int): Int = { @annotation.tailrec def loop(count: Int, sub: Int): Int = if (sub < n) count else loop(count + 1, sub - n) loop(0, m) }