private int cheapRandInt ( int max ) { _seed ^= ( _seed << 21 ) ; _seed ^= ( _seed >>> 35 ) ; _seed ^= ( _seed << 4 ) ; int r = ( int ) _seed % max ; return r > 0 ? r : - r ; }
This is cheap and moderate in quality .