一般的向下取整是用的Math.floor(), 也可以用这个: a = a | 0 ;亲测有效,这个不是逻辑或 而是按位或、 转载于:https://www.cnblogs.com/fordouble/p/7057926.html