axle.EnrichedInt.scala Maven / Gradle / Ivy
The newest version!
package axle
case class EnrichedInt(n: Int) {
def factorial: Int = (1 to n).foldLeft(1)(_ * _)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy
package axle
case class EnrichedInt(n: Int) {
def factorial: Int = (1 to n).foldLeft(1)(_ * _)
}