floorPowerOfTwo<T extends num> static method

double floorPowerOfTwo<T extends num>(
  1. T value
)

Implementation

static double floorPowerOfTwo<T extends num>(T value) {
  return math.pow(2, (math.log(value) / math.ln2).floor().toDouble()).toDouble();
}