Math

1.Math

1.1介绍

用于执行基本数字运算的工具类

1.2常用方法

1.2.1abs

public static int abs•(int a)//获取参数的绝对值

1.2ceil和floor

public static double ceil•(double a)//向上取整
   
public static double floor•(double a)//向下取整

1.2.3round

public static int round•(float a)//四舍五入

1.2.4max和min

public static int max•(int a,int b)
public static int min•(int a,int b)

1.2.5pow

public static double pow(double a,double b)//a的b次幂

1.2.6random

public static double random•()//返回值为double的随机值,范围[0.0,1.0)
posted @ 2024-03-21 14:32  灵泽pro  阅读(45)  评论(0)    收藏  举报