(math对象)
- round(): 四舍五入
- random(): 返回0 ~ 1之间的随机数
- max(): 返回最高值
- min(): 返回最低值
- abs(): 返回绝对值
<!--round()-->
<script>
function round_test(a){
document.write(Math.round(a));
}
</script>
<!--random()-->
<script>
function random_test(){
document.write(Math.random()*10);
}
</script>
<!--max()-->
<script>
function max_test(a,b,c){
document.write(Math.max(a,b,c));
}
</script>
<!--min()-->
<script>
function min_test(a,b,c){
document.write(Math.min(a,b,c);
}
</script>