java.math.Math类常用的常量和方法
来源:互联网 发布:mac电脑如何新建文件夹 编辑:程序博客网 时间:2024/05/28 05:18
Math.PI 圆周率
Math.E e的常量
Math.abs 求绝对值
Math.sin 正弦函数 Math.asin 反正弦函数
Math.cos 余弦函数 Math.acos 反余弦函数
Math.tan 正切函数 Math.atan 反正切函数 Math.atan2 商的反正切函数
Math.toDegrees 弧度转化为角度 Math.toRadians 角度转化为弧度
Math.ceil 得到不小于某数的最大整数
Math.floor 得到不大于某数的最大整数
例如:Math.floor(10.3) =10
Math.ceil(10.3) =11
ceil()是天花板,即向上取整。floor是地板,向下取整。round是四舍五入。
Math.IEEEremainder 求余
Math.max 求两数中最大
Math.min 求两数中最小
Math.sqrt 求开方
Math.pow 求某数的任意次方, 抛出ArithmeticException处理溢出异常
Math.sqrt(x):平方根
Math.pow(x,y):x的y次方
Math.exp 求e的任意次方
Math.log10 以10为底的对数
Math.log 自然对数
Math.rint 求距离某数最近的整数(可能比某数大,也可能比它小)
Math.round 同上,返回int型或者long型(上一个函数返回double型)
Math.random 返回0,1之间的一个随机数
- java.math.Math类常用的常量和方法
- java.math.Math类整理 常用的常量和方法
- Java.math.Math类常用的常量和方法
- java.math.Math类常用的常量和方法
- ava.math.Math类常用的常量和方法:
- Math类常用的常量和方法
- Java中Math类的常用方法
- java数学类Math的常用方法
- Java中Math类的常用方法
- Java中Math类的常用方法
- Java中Math类的常用方法
- Java中Math类的常用方法
- Java Math类 常用的方法
- JAVA中Math 类的常用方法
- Java中Math类的常用方法
- Java中Math类的常用方法
- Java中Math类的常用方法
- Java中Math类的常用方法
- Sql Server触发器
- 黑马程序员_多态和内部类
- Android实现程序前后台切换效果
- 数组指针和指针数组的区别
- 程序员如何增加收入
- java.math.Math类常用的常量和方法
- 服务器模型按场景的选择
- C++ 11语法甜点1
- Java的内存机制
- 利用线程池单线程下载网页信息
- 总结:程序设计基础
- pku 1308 Is It A Tree?(并查集)
- linux ps命令,查看进程cpu和内存占用率排序
- 如何在安装程序中判断操作系统是否是64位 inno