private function calcError($bits, $min, $max) { $err = ($max - $min) / 2; while ($bits--) { $err /= 2; } return $err; }