//第一種:是數字的取整,因為math.random()的取值范圍是大於等於0,小於1,取不到1
document.write(parseInt(Math.random()*3))//結果是0,1,2
//第二種:要想取到從1-3的隨機數必須從要在產生隨機數的后面加上1才可以從1開始取值,娶不到0;
document.write(parseInt(Math.random()*3)+1)//結果是1,2,3
//第三種是數字的向上取整必須是大於0開始,永遠取不到0
document.write(Math.ceil(Math.random()*3))//結果是1,2,3;
//第四種是數字的向下取整,必須是從0開始,最后的一個數字是取不到你想要的區間范圍的最后的一個數據
document.write(Math.floor(Math.random()*3))//結果是0,1,2
//第五種是數字的四舍五入取整隨機產生的隨機數有可能是大於0.5就會向前一位進1
document.write(Math.round(Math.random() * 3));//結果是0,1,2,3