java - Why does Math.ceil return a double? -
This one threw me for a bit of a loop when i The But why do What do I always feel that it should be? I am afraid that there are some limitations which are problematic. If meditation Given that what is the last line, the numbers interval on very large values (positive or negative) is going to be very low - so if you see the integer greater than Math.ceil (5.2) < / Code> then
is double
6.0 . My natural inclination was that
Math.ceil (double a) will return a
long document from:
roof (double A)
double returns the value which is less than the logic and is equal to the mathematical integer.
double return instead of
long when the result is an integer? This is not a necessary question, but I think that understanding the reason behind this will help me to understand Java a bit better. It can also help me to understand that if I would be having problems by casting on a
long , eg
Long B = (long) math.Syl (A);
double
is longer than example For:
Double X = Long.mx_avn; X = x * 1000; X = mathematics.Syl (x);
Math.ceil returned
x next integer
x + 1 will not mean what I mean.
Comments
Post a Comment