Home > Article > Web Front-end > What is the integer division symbol in JavaScript?
The integer division symbol of JavaScript is "/", and its integer division operation methods are: 1. "ceil(count/pagesize);" upward division method; 2. "floor(count/pagesize);" downward division method Method; 3. "round(5/2);" rounding method, etc.
The operating environment of this article: windows7 system, javascript version 1.8.5, DELL G3 computer
Integer division operation in js
Code such as:
Math.ceil(count / pagesize); //向上整除 4/3=2; Math.floor(count / pagesize); //向下整除 4/3=1; Math.round(5/2);//四舍五入 parseInt(5/2);//丢弃小数部分,保留整数部分
Recommended study: "javascript Advanced Tutorial"
The above is the detailed content of What is the integer division symbol in JavaScript?. For more information, please follow other related articles on the PHP Chinese website!