floorPowerOfTwo<T extends num> static method

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

Implementation

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