
Explain the following functions:
1. Math.random()
2. Math.max()
3. Math.cbrt()
4. Math.abs()
5. Math.log()
---------------------------------------------------
☆ No spam
☆ No plagiarism
otherwise answer will surely be reported =_=
Answers
Explanation:
1}. Math rondom() : Random is used to return a pseudorandom double type of number greater than or equal to 0.0 and less than 1.0. The default random number always generated between 0 and 1. If you want to specify range you have to multiple the returned value with magnitude of the range.
2}. Math max() : Math max ( - 7, Math min { 2-9}math min - 2, - 9 = - 9 ( minimum of two}
Math max ( - 7,-9}
Math. Max ( - 7,-9} = - 7 ( maximum of two}
Math max (-7, Math min ( - 2, - 9) = - 7
3}. Math cbrt () : cbrt () method is used to find the cube root of a double value for java for the given input ( x) crbt (x) ; that is, the Cube root of a negative value is the negative cube root of that values magnitude. The computed result must be within 1 ulp of the exact result.
4}. Math. abs () : the abs function returns absolute value of a number. If the abs () function is passed a non- numeric value, an array with one than one element, or an empty object as the number parameter, the abs () function will return Nan { not a number.
5}. Math. log() : if value of x is 0 is always, the return value is always infinite. If the value is negative the return value is always. Because log () is a static method of math. You always it as math.log rather rather than as a method if math object you created { math is not a constructor.}
I hope it may help to you sis.... ☺️❤️