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 @   灵泽pro  阅读(37)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
点击右上角即可分享
微信分享提示