Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Java 8. Math.ceil() function description

I do see following description (in docs) for the function Math.ceil(double a):

Returns the smallest (closest to negative infinity) double value that
is greater than or equal to the argument and is equal to a
mathematical integer.

Do I something miss or it is incorrect in here "Returns the smallest (closest to negative infinity)"?
I mean, when you do use it, whatever not zero number there will be after decimal point, it will always be upped in positive direction, not negative (so it returns closest to positive infinity).

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

What you are saying is right. The definition mentioned is wrong. It returns the number in the positive direction. for example, math.ceil(4.7) would return 5

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading