private static int toEven(float value){
  int i=Math.round(value);
  return (i % 2 == 1) ? i - 1 : i;
}

private static int toEven ( float value ) { int i = Math . round ( value ) ; return ( i % 2 == 1 ) ? i - 1 : i ; }
casts the value to an even integer .
