JavaScript math operations | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

JavaScript math operations

Pls what does Math.floor and Math.ceil mean? And ehat is the difference between the two?

21st Jul 2018, 10:27 AM
Emeruche Ikenna Cole
Emeruche Ikenna Cole - avatar
2 Answers
+ 2
Never mind, saw it now. The ceil() method of math object is used to get the smallest integer, greater than or equal to a number.
21st Jul 2018, 10:35 AM
Emeruche Ikenna Cole
Emeruche Ikenna Cole - avatar
+ 4
it is the way you round a number floor always rounds down and ceil rounds up floor(2.7) --> 2 ceil(2.3) --> 3
21st Jul 2018, 10:34 AM
Matthias
Matthias - avatar