請(qǐng)問函數(shù)名為 ath 為什么函數(shù)里輸入math也有輸出呢
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Math </title>
<script type="text/javascript">
function ath(x){
? ? document.write(Math.ceil(x)+"<br />");
? ? }
? ??
? ? ath(3.3);
? ? math(3.3);
</script>
</head>
<body>
</body>
</html>
2016-09-22
按照你定義的函數(shù),其輸出應(yīng)該是這樣的:
2016-09-18
math(3.3)沒有輸出,ath函數(shù)輸出的是Math.ceil(x)的值。Math是一個(gè)對(duì)象,提供對(duì)數(shù)據(jù)的數(shù)學(xué)計(jì)算,ceil是Math對(duì)象的一個(gè)方法,即向上取整。
2016-09-18
ath是自定義的函數(shù),有一行輸出。
但是math(3.3)應(yīng)該沒有輸出,因?yàn)榻忉屍鞑徽J(rèn)識(shí)