概率相等红包
parent
3742a2aa74
commit
13fb52cd3a
|
@ -43,6 +43,9 @@ public class HongBaoAlgorithm {
|
|||
* @return
|
||||
*/
|
||||
static long xRandom(long min, long max) {
|
||||
if(min == max){
|
||||
return 0;
|
||||
}
|
||||
return sqrt(nextLong(sqr(max - min)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue