O'Reilly logo
  • Russell Reed thinks this is interesting:

private def decimals(n: Long): Int =    if (n == 10 else 1 + decimals(n / 10)

From

Cover of Programming in Scala, Third Edition

Note

Broken. Stack overflow for values less than 10, and returns 1 more than expected for values of 10 and up.