Computer Science, asked by arijeetsengupta, 7 months ago

M = (a3 + b3 +c) ^ 1/2
using mathematical library methods ​

Answers

Answered by Oreki
1

Java Expression:

M = Math.pow(Math.pow(a, 3) + Math.pow(b, 3) + c , 0.5f);

Answered by skakss123
1

Answer:

Math.rint method rounds off its argument to the nearest mathematical integer and returns its value as a double type. The nearest integer to -99.4 is -99.0 so that is the output. Math.rint method behaves in a particular way at the mid-point i.e. when the decimal part of the argument is 0.5. In such cases, the result is the integer value that is even. Let's understand this with an example. Math.rint(1.5) and Math.rint(2.5) will both return 2.0. In the case of 1.5, both 1.0 and 2.0 are equally close to 1.5. Math.rint choses the integer that is even so 2.0 is returned. In the case of 2.5, both 2.0 and 3.0 are equally close to 2.5. Math.rint again choses the integer that is even so 2.0 is returned.

Similar questions