public static int floorHalf(int num){
  if ((num & 1) == 1) {
    return (num - 1) / 2;
  }
 else {
    return num / 2;
  }
}

public static int floorHalf ( int num ) { if ( ( num & 1 ) == 1 ) { return ( num - 1 ) / 2 ; } else { return num / 2 ; } }
returns the floor of the half of the input value
