From: <kea...@na...> - 2003-03-27 16:29:46
|
> I may fail to understand the code, but it seems wrong to me > so I changed it to > > public static final int random(int start, int end) { > int iRet = start + (int) ((end - start + > 1)*java.lang.Math.random()); > return iRet > end ? end : iRet; > } Your code looks right to me, but the final test is unnecessary, since Math.random() is always less than 1.0. Eric, I think this was your thing. Do you want to do the fix, or shall I? Keats |