Configuration

Night mode

Floor

Introduction To Java Course

Engineers From These Top Companies and Universities Trust EXLskills

1M+ Professionals | 100+ Institutions

This is the EXLskills free and open-source Introduction To Java Course. It guides learners via explanation, demonstration, and thorough practice, from no more than a basic understanding of Java, to a moderate level of essential coding proficiency.

Is this course FREE?

Yes, this a 100% free course that you can contribute to on GitHub here!

As the nearest whole number that is less than or equal to 10.4 is 10, 10.0 is printed. Similarly, since the closest whole number that is less than or equal to -20.4 is -21, -21.0 is printed. Notice that even if we input a non-decimal number into the floor function, a double is returned. Since data precision is not hindered when you convert from an int data type to a double, Java will do it without throwing any errors. The floor function's primary use is rounding, all ready for you to use while coding.