floor()方法的基本语法:
math . floor(x);X代表一个数字,返回小于或等于数字X的最大整数.
让我们看看下面的具体例子
代码如下
!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浏览器的效果如下:所有数字的输出将小于或等于它们的最大整数。
以上就是本文关于地板知识点的全部内容。谢谢你的支持。