perfolation.numeric.RoundingMode.scala Maven / Gradle / Ivy
package perfolation.numeric
trait RoundingMode {
def roundUp(i: Int): Boolean
}
object RoundingMode {
case object HalfUp extends RoundingMode {
override def roundUp(i: Int): Boolean = i >= 5
}
case object HalfDown extends RoundingMode {
override def roundUp(i: Int): Boolean = i > 5
}
case object Ceil extends RoundingMode {
override def roundUp(i: Int): Boolean = i > 0
}
case object Floor extends RoundingMode {
override def roundUp(i: Int): Boolean = false
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy