question: public static void normalize ( double [ ] doubles , double sum ) { if ( Double . isNaN ( sum ) ) { throw new IllegalArgumentException ( "Can't normalize array. Sum is NaN." ) ; } if ( sum == 0 ) { throw new IllegalArgumentException ( "Can't normalize array. Sum is zero." ) ; } for ( int i = 0 ; i < doubles . length ; i ++ ) { doubles [ i ] /= sum ; } }
target:  Normalizes the doubles in the array using the given value.