All Downloads are FREE. Search and download functionalities are using the official Maven repository.

perfolation.numeric.RoundingMode.scala Maven / Gradle / Ivy

There is a newer version: 1.2.9
Show newest version
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