Computer Applications
Given double b = Math.ceil(3.4) + Math.pow(2,3);
What will be the final value stored in the variable b?
- 12.0
- 11.0
- 11.4
- 11.5
Java Math Lib Methods
13 Likes
Answer
12.0
Reason — Math.ceil() returns the smallest whole number greater than or equal to its argument. Math.pow(a,b) returns the value ab. So, the final value of b will be:
b = Math.ceil(3.4) + Math.pow(2,3);
⇒ b = 4.0 + 8.0
⇒ b = 12.0
Answered By
6 Likes
Related Questions
Given: d = Math.min(-15.5, -19.5);
What data type will you refer for the variable d?- int
- float
- double
- None
Given: double k = Math.rint(-9.4) + Math.sqrt(9.0);
What will be the final value stored in the variable k?- -5.0
- -6.0
- -6.4
- -5.4
State whether the following statement is True or False :
The return data type of Math.log() is double.
State whether the following statement is True or False :
Java.Math class is used for different mathematical functions.