java: math class

java.util.Meth class provides a wealth of mathematical tools to complete mathematical operations related to operations

public static void abs (double num): takes the absolute value

public static double ceil (double num) : rounding up, to take a large integer, for example: rounding 12.2 13.0    Note: When is negative, is the largest integer rounding, = -12.0 -12.2

public static double floor (double num): rounded down, to take a small integer, for example: 12.2 = 12.0 = -13.0 -12.2

public statuc long round (double num) : rounding , decimal last 5 is taken to a large integer, for example: 13 = -12.5 = -12,12.5

Guess you like

Origin www.cnblogs.com/BatmanY/p/11799577.html