![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 50
AshenOne余烬
No one can hide from my sights.
展开
-
流水号变换算法(9位)
int num = (((seq^12345678) & 0x7F)>>7; 流水号变换算法,供参考 只用了29位(bit),一个卡bin能发5亿多。9位流水号理论上能发10亿,由于有位运算,只用29位,30位就超过10亿了原创 2016-11-15 11:50:18 · 576 阅读 · 0 评论 -
【java】对资源按照各渠道引流概率(区间长度)进行分配
敲了半个下午,还有需要优化的地方。 /** * Created by yang.jin on 14/12/2016. */ public class RouterTest { public static void main(String[] args){ String sp_range_list_str = "100,240,200,360,270,100,340,2原创 2016-12-14 16:30:38 · 557 阅读 · 0 评论 -
JAVA 生成n个数,使其和为1
/** * Created by yang.jin on 13/12/2016. */ public class RandomRouter { public static int totalSp=3; public static void main(String[] args){ double random=0.0,sum=0.0; doub原创 2016-12-15 15:49:54 · 686 阅读 · 0 评论