Home  >  Article  >  Web Front-end  >  What is the integer division symbol in JavaScript?

What is the integer division symbol in JavaScript?

藏色散人
藏色散人Original
2021-05-19 11:01:0112707browse

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.

What is the integer division symbol in JavaScript?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn