which of the following will produce an answer that is closest in value to a double , d. while not being greater than d?

which of the following will produce an answer that is closest in value to a double , d. while not being greater than d? Correct Answer (int)Math.Floor(d);

Description The method floor gives the largest integer that is less than or equal to the argument. Syntax This method has the following variants − double floor(double d) double floor(float f) Parameters Here is the detail of parameters − A double or float primitive data type. Return Value This method returns the largest integer that is less than or equal to the argument. Returned as a double. Example Live Demo public class Test { public static void main(String args[]) { double d = - 100.675; float f = - 90; System.out.println(Math.floor(d)); System.out.println(Math.floor(f)); System.out.println(Math.ceil(d)); System.out.println(Math.ceil(f)); } } This will produce the following result − Output - 101.0 - 90.0 - 100.0 - 90.0
Bissoy MCQ

Related Questions

Which of the following will produce an answer that is closest in value to a double, d, while not being greater than d?
Which of the following will produce an answer that is close in value to a double ' d while not being greater than d?
L is older than M and taller than N. O is younger than P, older than N and shorter than Q. R is older than S, younger than N, shorter than S and taller than Q. S is older than L, M, O, P, Q, R and S is necessarily false?
The word bounty is closest is closest in meaning to--
Aida divides a number greater than 100 by a number greater than 10. Which statement about Aida's quotient is always true?