private static int sign(int x,int y){
  int result=Math.abs(x);
  if (y < 0.0) {
    result=-result;
  }
  return result;
}

private static int sign ( int x , int y ) { int result = Math . abs ( x ) ; if ( y < 0.0 ) { result = - result ; } return result ; }
constructs an int with the absolute value of x and the sign of y
