Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Kjetil-Lennart A. Lorentzen
13,390 PointsStruggeling with the math. Help.
I am seriously struggeling with the math, i thought i understood it when i encountered it in the course. but you know what? I don't.
This is the only thing that made this challange hard for me, i didn't know where to put the lower and upper.
Can somebody please explain the math to me like i am a 5 year old?
2 Answers

Prsicilla Anesu Muzerengwa
12,576 PointsHi Kjetil-Lennart. JavaScript Math object allows you to perform mathematical tasks on numbers. Below I have list a few examples they are many more.
`Math.random() returns a random number between 0 (inclusive), and 1 (exclusive): Math.random(); // returns a random number
Math.round() Math.round(x) returns the value of x rounded to its nearest integer: Example Math.round(4.7); // returns 5 Math.round(4.4); // returns 4
Math.ceil() Math.ceil(x) returns the value of x rounded up to its nearest integer: Example Math.ceil(4.4); // returns 5
Math.floor() Math.floor(x) returns the value of x rounded down to its nearest integer: Example Math.floor(4.7); // returns 4

Johnnt Trav
Courses Plus Student 1,295 PointsFor more insight visit this link: https://teamtreehouse.com/community/mathfloor-mathrandom-max-min-1-min-explanation
Kjetil-Lennart A. Lorentzen
13,390 PointsKjetil-Lennart A. Lorentzen
13,390 PointsThank you very much for your answer, these i knew, but! But i don't get the actual math there, i know it had something to do with finding the range between the number and such, but i can't get my head around how it works. You are very kind to take the time to answer