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

nl.vroste.rezilience.Util.scala Maven / Gradle / Ivy

There is a newer version: 0.10.3
Show newest version
package nl.vroste.rezilience

private object Util {
  final def nextPow2(n: Int): Int = {
    val nextPow = (Math.log(n.toDouble) / Math.log(2.0)).ceil.toInt
    Math.pow(2.0, nextPow.toDouble).toInt.max(2)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy