欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

javascript中floor使用方法總結(jié)

 更新時間:2019年02月02日 10:59:05   投稿:laozhang  
在本篇文章中小編給大家分享了關(guān)于javascript中floor使用的知識點內(nèi)容,有興趣的朋友們學(xué)習(xí)下。

floor()方法的基本語法

Math.floor( x ) ;

x表示數(shù)字,返回小于或等于數(shù)字x的最大整數(shù)。

我們下面來看具體的示例

代碼如下

<!DOCTYPE html>
<html>
 <head>
  <title></title>
 </head>
 <body> 
<script type="text/javascript"> 
 document.write(Math.floor(-2)+"<br/>"); 
 document.write(Math.floor(-2.56)+"<br/>"); 
 document.write(Math.floor(2.56)+"<br/>"); 
  document.write(Math.floor(7.2+9.3));  
</script> 
 </body>
</html>

瀏覽器上運行效果如下:所有數(shù)字的輸出都會小于或等于其最大整數(shù)。

以上就是本篇關(guān)于floor知識點的全部內(nèi)容,感謝大家對腳本之家的支持。

相關(guān)文章

最新評論