Home >Web Front-end >JS Tutorial >Analysis of the difference between JavaScript integer division function ceil and floor_javascript skills

Analysis of the difference between JavaScript integer division function ceil and floor_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:04:071690browse

This article analyzes the difference between JavaScript integer division operation functions ceil and floor with examples. Share it with everyone for your reference. The specific analysis is as follows:

Math.ceil(count / pagesize);
//向上整除,如 Math.ceil(4/3)结果为2;
Math.floor(count / pagesize);
//向下整除,如 Math.floor(4/3)结果为1;

I hope this article will be helpful to everyone’s JavaScript programming design.

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