math.abs () returns the absolute value of the specified number.
Math.max () and math.min () return two parameters (belonging to the same number type), respectively, to the larger number and the smaller number.
Math.pow () returns the base of the first argument, and the second argument is the result of a power operation of the exponent.
Math.ceil () ceil means the ceiling, which means rounding up. As the result of Math.ceil (11.3), the result of 12,math.ceil (-11.3) is-11.
Math.floor () floor means flooring, which means rounding down. As the result of Math.floor (11.6), the result of 11,math.floor (-11.6) is-12.
Math.Round () The method represents rounding, the algorithm is Math.floor (x+0.5), and the original number plus 0.5 is rounded down. Such as:
The result of Math.Round (8.9) is that the result of 9,math.round (8.1) is 8.
The result of Math.Round (-8.9) is that the result of -8,math.round (-8.1) is-8.
math.random () This method represents taking a random number and returning a double with a positive value, which is [0, 1].
Common methods of the math class