摘要: function randomFloat($min = 0, $max = 1) { $rand = mt_rand(); $lmax = mt_getrandmax(); return $min + $rand / $lmax * ($max - $min);}var_dump(randomFloat());var_dump(randomFloat(1, 100000));随机浮点数函数! 阅读全文
posted @ 2014-03-04 18:10 老骆 阅读(848) 评论(0) 推荐(0) 编辑