返回 m 到 n 的随机整数

返回 m 到 n 的随机整数

<script type="text/javascript">
function randomNumber(m,n){
    return Math.round(Math.random()*(n-m)+m);
}
</script>
posted @ 2013-07-22 12:50  HughTan  阅读(287)  评论(0编辑  收藏  举报