public static int uniform ( int a , int b ) { if ( b <= a ) throw new IllegalArgumentException ( "Invalid range" ) ; if ( ( long ) b - a >= Integer . MAX_VALUE ) throw new IllegalArgumentException ( "Invalid range" ) ; return a + uniform ( b - a ) ; }
Returns a random integer uniformly in [ a b ) .